summaryrefslogtreecommitdiff
path: root/jstests/mmap_v1
diff options
context:
space:
mode:
authorDan Pasette <dan@10mongodb.com>2014-10-16 12:03:35 -0400
committerDan Pasette <dan@mongodb.com>2014-10-16 12:03:35 -0400
commit4590de9cbd7005a9603daa371c70e0eca9f671e9 (patch)
tree819c4b711ea3d2fa2501c929f8d26e1146ddd0d3 /jstests/mmap_v1
parent1579d801925ce9b92de088ca766483540cf6e741 (diff)
downloadmongo-4590de9cbd7005a9603daa371c70e0eca9f671e9.tar.gz
SERVER-13635: don't run dur_remove_old_journals.js on 32-bit platforms
Diffstat (limited to 'jstests/mmap_v1')
-rw-r--r--jstests/mmap_v1/dur_remove_old_journals.js87
1 files changed, 46 insertions, 41 deletions
diff --git a/jstests/mmap_v1/dur_remove_old_journals.js b/jstests/mmap_v1/dur_remove_old_journals.js
index e309eee7b2d..59f50f9c359 100644
--- a/jstests/mmap_v1/dur_remove_old_journals.js
+++ b/jstests/mmap_v1/dur_remove_old_journals.js
@@ -1,52 +1,57 @@
// this test makes sure that old journal files are removed
-// tunables
-STRING_SIZE = 1024*1024;
-NUM_TO_INSERT = 2.5*1024;
-PATH = MongoRunner.dataDir + "/dur_remove_old_journals";
-SYNC_DELAY = 5; // must be a number
-
-conn = startMongodEmpty("--port", 30001, "--dbpath", PATH, "--dur", "--smallfiles", "--syncdelay", ''+SYNC_DELAY);
-db = conn.getDB("test");
-
-longString = 'x';
-while (longString.length < STRING_SIZE)
- longString += longString;
-
-numInserted = 0;
-while (numInserted < NUM_TO_INSERT){
- db.foo.insert({_id: numInserted++, s:longString});
-
-
- if (numInserted % 100 == 0){
- print("numInserted: " + numInserted);
- db.adminCommand({fsync:1});
- db.foo.remove({});
- db.adminCommand({fsync:1});
- }
+if (db.serverBuildInfo().bits == 32) {
+ print("skip on 32 bit systems");
}
+else {
+ // tunables
+ STRING_SIZE = 1024*1024;
+ NUM_TO_INSERT = 2.5*1024;
+ PATH = MongoRunner.dataDir + "/dur_remove_old_journals";
+ SYNC_DELAY = 5; // must be a number
+
+ conn = startMongodEmpty("--port", 30001, "--dbpath", PATH, "--dur", "--smallfiles", "--syncdelay", ''+SYNC_DELAY);
+ db = conn.getDB("test");
+
+ longString = 'x';
+ while (longString.length < STRING_SIZE)
+ longString += longString;
+
+ numInserted = 0;
+ while (numInserted < NUM_TO_INSERT){
+ db.foo.insert({_id: numInserted++, s:longString});
+
+
+ if (numInserted % 100 == 0){
+ print("numInserted: " + numInserted);
+ db.adminCommand({fsync:1});
+ db.foo.remove({});
+ db.adminCommand({fsync:1});
+ }
+ }
-sleepSecs = SYNC_DELAY + 15 // long enough for data file flushing and journal keep time
-print("\nWaiting " + sleepSecs + " seconds...\n");
-sleep(sleepSecs*1000);
+ sleepSecs = SYNC_DELAY + 15 // long enough for data file flushing and journal keep time
+ print("\nWaiting " + sleepSecs + " seconds...\n");
+ sleep(sleepSecs*1000);
-files = listFiles(PATH + "/journal")
-printjson(files);
+ files = listFiles(PATH + "/journal")
+ printjson(files);
-var nfiles = 0;
-files.forEach(function (file) {
- assert.eq('string', typeof (file.name)); // sanity checking
- if (/prealloc/.test(file.name)) {
- ;
- }
- else {
- nfiles++;
- }
-})
+ var nfiles = 0;
+ files.forEach(function (file) {
+ assert.eq('string', typeof (file.name)); // sanity checking
+ if (/prealloc/.test(file.name)) {
+ ;
+ }
+ else {
+ nfiles++;
+ }
+ })
-assert.eq(2, nfiles); // latest journal file and lsn
+ assert.eq(2, nfiles); // latest journal file and lsn
-stopMongod(30001);
+ stopMongod(30001);
+}
print("*** success ***");