Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-6576 SERVER-6602 Fix loadserverscripts.js to clear variables s…

…o it can be run multiple times in a row and to wait until a parallel shell insert completes before checking the result.
  • Loading branch information...
commit d7a5f9060c3bd3b5ba478fde7f98a65ca4ea152f 1 parent 1a17d25
@astaple astaple authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 jstests/loadserverscripts.js
View
5 jstests/loadserverscripts.js
@@ -10,6 +10,8 @@ var x;
// clear out any data from old tests
testdb.system.js.remove();
+delete myfunc;
+delete myfunc2;
x = testdb.system.js.findOne();
assert.isnull(x, "Test for empty collection");
@@ -34,7 +36,8 @@ assert.eq(x, "myfunc", "Checking that myfunc() returns the correct value");
// Insert value into collection from another process
var coproc = startParallelShell(
'db.getSisterDB("loadserverscripts").system.js.insert' +
- ' ( {_id: "myfunc2", "value": function(){ return "myfunc2"; } } ); '
+ ' ( {_id: "myfunc2", "value": function(){ return "myfunc2"; } } );' +
+ 'db.getLastError();'
);
// wait for results
coproc();
Please sign in to comment.
Something went wrong with that request. Please try again.