Permalink
Browse files

crlf

  • Loading branch information...
1 parent 9677a99 commit 9b6885b71fff4b4cfb34ea6ad8ec0f1c970d6fde @dwight dwight committed Jan 1, 2011
Showing with 268 additions and 268 deletions.
  1. +3 −3 jstests/capped3.js
  2. +19 −19 jstests/dur/a_quick.js
  3. +20 −20 jstests/dur/dropdb.js
  4. +32 −32 jstests/dur/dur1.js
  5. +48 −48 jstests/dur/dur2.js
  6. +67 −67 jstests/dur/dur_passthrough.js
  7. +60 −60 jstests/dur/oplog.js
  8. +3 −3 jstests/objid5.js
  9. +16 −16 jstests/shellstartparallel.js
View
@@ -23,9 +23,9 @@ c = t2.find().sort( {$natural:-1} );
i = 999;
while( c.hasNext() ) {
assert.eq( i--, c.next().i, "E" );
-}
-//print( "i: " + i );
-var str = tojson( t2.stats() );
+}
+//print( "i: " + i );
+var str = tojson( t2.stats() );
//print( "stats: " + tojson( t2.stats() ) );
assert( i < 990, "F" );
View
@@ -8,25 +8,25 @@ print("a_quick.js");
// directories
var path1 = "/data/db/quicknodur";
-var path2 = "/data/db/quickdur";
-
-function runDiff(a, b) {
- function reSlash(s) {
- var x = s;
- if (_isWindows()) {
- while (1) {
- var y = x.replace('/', '\\');
- if (y == x)
- break;
- x = y;
- }
- }
- return x;
- }
- a = reSlash(a);
- b = reSlash(b);
- print("diff " + a + " " + b);
- return run("diff", a, b);
+var path2 = "/data/db/quickdur";
+
+function runDiff(a, b) {
+ function reSlash(s) {
+ var x = s;
+ if (_isWindows()) {
+ while (1) {
+ var y = x.replace('/', '\\');
+ if (y == x)
+ break;
+ x = y;
+ }
+ }
+ return x;
+ }
+ a = reSlash(a);
+ b = reSlash(b);
+ print("diff " + a + " " + b);
+ return run("diff", a, b);
}
var step = 1;
View
@@ -5,26 +5,26 @@ durability test dropping a database
var debugging = false;
var testname = "dropdb";
var step = 1;
-var conn = null;
-
-function runDiff(a, b) {
- function reSlash(s) {
- var x = s;
- if (_isWindows()) {
- while (1) {
- var y = x.replace('/', '\\');
- if (y == x)
- break;
- x = y;
- }
- }
- return x;
- }
- a = reSlash(a);
- b = reSlash(b);
- print("diff " + a + " " + b);
- return run("diff", a, b);
-}
+var conn = null;
+
+function runDiff(a, b) {
+ function reSlash(s) {
+ var x = s;
+ if (_isWindows()) {
+ while (1) {
+ var y = x.replace('/', '\\');
+ if (y == x)
+ break;
+ x = y;
+ }
+ }
+ return x;
+ }
+ a = reSlash(a);
+ b = reSlash(b);
+ print("diff " + a + " " + b);
+ return run("diff", a, b);
+}
function log(str) {
if (str)
View
@@ -5,28 +5,28 @@
var debugging = false;
var testname = "dur1";
var step = 1;
-var conn = null;
-
-function runDiff(a, b) {
- function reSlash(s) {
- var x = s;
- if (_isWindows()) {
- while (1) {
- var y = x.replace('/', '\\');
- if (y == x)
- break;
- x = y;
- }
- }
- return x;
- }
- a = reSlash(a);
- b = reSlash(b);
- print("diff " + a + " " + b);
- return run("diff", a, b);
-}
-
-function log(str) {
+var conn = null;
+
+function runDiff(a, b) {
+ function reSlash(s) {
+ var x = s;
+ if (_isWindows()) {
+ while (1) {
+ var y = x.replace('/', '\\');
+ if (y == x)
+ break;
+ x = y;
+ }
+ }
+ return x;
+ }
+ a = reSlash(a);
+ b = reSlash(b);
+ print("diff " + a + " " + b);
+ return run("diff", a, b);
+}
+
+function log(str) {
print();
if(str)
print(testname+" step " + step++ + " " + str);
@@ -108,16 +108,16 @@ stopMongod(30002);
// 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");
-{
- if (ls(path2 + "/journal") != null) {
- // wait longer, stopMongod isn't synchronous
- sleep(8000);
- if (ls(path2 + "/journal") != null) {
- assert(false, "error seems to be journal files present after a clean mongod shutdown");
- }
- }
+// at this point, after clean shutdown, there should be no journal files
+log("check no journal files");
+{
+ if (ls(path2 + "/journal") != null) {
+ // wait longer, stopMongod isn't synchronous
+ sleep(8000);
+ if (ls(path2 + "/journal") != null) {
+ assert(false, "error seems to be journal files present after a clean mongod shutdown");
+ }
+ }
}
log("check data matches ns");
View
@@ -1,15 +1,15 @@
/*
test durability
a little longer
-*/
-
-var debugging = false;
+*/
+
+var debugging = false;
var testname = "dur2";
var step = 1;
-var conn = null;
-
-var start = new Date();
-function howLongSecs() {
+var conn = null;
+
+var start = new Date();
+function howLongSecs() {
return (new Date() - start) / 1000;
}
@@ -18,52 +18,52 @@ function log(str) {
print("\n" + testname+" step " + step++ + " " + str);
else
print(testname+" step " + step++);
-}
-
-function verify() {
- log("verify");
- var d = conn.getDB("test");
- var mycount = d.foo.count();
- print("count:" + mycount);
- assert(mycount>2, "count wrong");
-}
-
+}
+
+function verify() {
+ log("verify");
+ var d = conn.getDB("test");
+ var mycount = d.foo.count();
+ print("count:" + mycount);
+ assert(mycount>2, "count wrong");
+}
+
// if you do inserts here, you will want to set _id. otherwise they won't match on different
// runs so we can't do a binary diff of the resulting files to check they are consistent.
-function work() {
+function work() {
log("work");
- x = 'x'; while(x.length < 1024) x+=x;
- var d = conn.getDB("test");
- d.foo.drop();
- d.foo.insert({});
-
- // go long enough we will have time to kill it later during recovery
- var j = 2;
- var MaxTime = 15;
- if (Math.random() < 0.05) {
- print("doing a longer pass");
- MaxTime = 90;
- }
- while (1) {
- d.foo.insert({ _id: j, z: x });
- d.foo.update({ _id: j }, { $inc: { a: 1} });
- if (j % 25 == 0)
- d.foo.remove({ _id: j });
- j++;
- if( j % 3 == 0 )
- d.foo.update({ _id: j }, { $inc: { a: 1} }, true);
- if (j % 10000 == 0)
- print(j);
- if (howLongSecs() > MaxTime)
- break;
- }
-
- verify();
+ x = 'x'; while(x.length < 1024) x+=x;
+ var d = conn.getDB("test");
+ d.foo.drop();
+ d.foo.insert({});
+
+ // go long enough we will have time to kill it later during recovery
+ var j = 2;
+ var MaxTime = 15;
+ if (Math.random() < 0.05) {
+ print("doing a longer pass");
+ MaxTime = 90;
+ }
+ while (1) {
+ d.foo.insert({ _id: j, z: x });
+ d.foo.update({ _id: j }, { $inc: { a: 1} });
+ if (j % 25 == 0)
+ d.foo.remove({ _id: j });
+ j++;
+ if( j % 3 == 0 )
+ d.foo.update({ _id: j }, { $inc: { a: 1} }, true);
+ if (j % 10000 == 0)
+ print(j);
+ if (howLongSecs() > MaxTime)
+ break;
+ }
+
+ verify();
d.runCommand({ getLastError: 1, fsync: 1 });
}
-if( debugging ) {
- // mongod already running in debugger
+if( debugging ) {
+ // mongod already running in debugger
print("DOING DEBUG MODE BEHAVIOR AS 'db' IS DEFINED -- RUN mongo --nodb FOR REGULAR TEST BEHAVIOR");
conn = db.getMongo();
work();
@@ -77,7 +77,7 @@ log();
var path2 = "/data/db/" + testname+"dur";
// durable version
-log();
+log();
conn = startMongodEmpty("--port", 30001, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", /*DurParanoid*/8, "--master", "--oplogSize", 64);
work();
Oops, something went wrong.

0 comments on commit 9b6885b

Please sign in to comment.