summaryrefslogtreecommitdiff
path: root/jstests/dur/diskfull.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/dur/diskfull.js')
-rw-r--r--jstests/dur/diskfull.js51
1 files changed, 26 insertions, 25 deletions
diff --git a/jstests/dur/diskfull.js b/jstests/dur/diskfull.js
index da45c20..c123ea1 100644
--- a/jstests/dur/diskfull.js
+++ b/jstests/dur/diskfull.js
@@ -14,23 +14,23 @@ for ( i in files ) {
if ( !doIt ) {
print( "path " + startPath + " missing, skipping diskfull test" );
doIt = false;
-}
-
-function checkNoJournalFiles(path, pass) {
- var files = listFiles(path);
- if (files.some(function (f) { return f.name.indexOf("prealloc") < 0; })) {
- if (pass == null) {
- // wait a bit longer for mongod to potentially finish if it is still running.
- sleep(10000);
- return checkNoJournalFiles(path, 1);
- }
- print("\n\n\n");
- print("FAIL path:" + path);
- print("unexpected files:");
- printjson(files);
- assert(false, "FAIL a journal/lsn file is present which is unexpected");
- }
-}
+}
+
+function checkNoJournalFiles(path, pass) {
+ var files = listFiles(path);
+ if (files.some(function (f) { return f.name.indexOf("prealloc") < 0; })) {
+ if (pass == null) {
+ // wait a bit longer for mongod to potentially finish if it is still running.
+ sleep(10000);
+ return checkNoJournalFiles(path, 1);
+ }
+ print("\n\n\n");
+ print("FAIL path:" + path);
+ print("unexpected files:");
+ printjson(files);
+ assert(false, "FAIL a journal/lsn file is present which is unexpected");
+ }
+}
/** Clear dbpath without removing and recreating diskfulltest directory, as resetDbpath does */
function clear() {
@@ -56,7 +56,9 @@ function work() {
d.foo.insert( { _id:i, b:big } );
}
- d.getLastError();
+ gle = d.getLastError();
+ if ( gle )
+ throw gle;
} catch ( e ) {
print( e );
raise( e );
@@ -86,9 +88,8 @@ function runFirstMongodAndFillDisk() {
conn = startMongodNoReset("--port", 30001, "--dbpath", startPath, "--dur", "--smallfiles", "--durOptions", 8, "--noprealloc");
assert.throws( work, null, "no exception thrown when exceeding disk capacity" );
- waitMongoProgramOnPort( 30001 );
-
- // the above wait doesn't work on windows
+ stopMongod( 30001 );
+
sleep(5000);
}
@@ -104,9 +105,9 @@ function runSecondMongdAndRecover() {
// stopMongod seems to be asynchronous (hmmm) so we sleep here.
sleep(5000);
- // at this point, after clean shutdown, there should be no journal files
- log("check no journal files");
- checkNoJournalFiles(startPath + "/journal/");
+ // at this point, after clean shutdown, there should be no journal files
+ log("check no journal files");
+ checkNoJournalFiles(startPath + "/journal/");
log();
}
@@ -133,4 +134,4 @@ if ( doIt ) {
print(testname + " SUCCESS");
-} \ No newline at end of file
+}