summaryrefslogtreecommitdiff
path: root/jstests/count10.js
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2013-10-04 12:58:23 -0400
committerIan Whalen <ian@mongodb.com>2013-10-04 16:42:09 -0400
commitb297497910d07493c84eab330d2ed4fcd9e34502 (patch)
treee0a5d8c4b70f23e4e96ea80d3a02f6241f07c487 /jstests/count10.js
parent6c68034f641f9f50e10ab68ac660242a53373ec1 (diff)
downloadmongo-b297497910d07493c84eab330d2ed4fcd9e34502.tar.gz
SERVER-11035 fix count10.js MCI failures
Signed-off-by: Ian Whalen <ian@mongodb.com>
Diffstat (limited to 'jstests/count10.js')
-rw-r--r--jstests/count10.js31
1 files changed, 16 insertions, 15 deletions
diff --git a/jstests/count10.js b/jstests/count10.js
index cb2979d4f69..478c30a4393 100644
--- a/jstests/count10.js
+++ b/jstests/count10.js
@@ -9,26 +9,27 @@ for ( i=0; i<100; i++ ){
// make sure data is written
db.getLastError();
-var thr = new Thread(function () {
+s = startParallelShell(
+ 'sleep(1000); ' +
+ 'current = db.currentOp({"ns": db.count10.getFullName(), "query.count": db.count10.getName()}); ' +
+ 'assert(current); ' +
+ 'countOp = current.inprog[0]; ' +
+ 'assert(countOp); ' +
+ 'db.killOp(countOp.opid); '
+);
+
+function getKilledCount() {
try {
db.count10.find("sleep(1000)").count();
- }
- catch (e) {
+ } catch (e) {
return e;
}
-});
-
-thr.start();
-sleep(1000);
-
-current = db.currentOp({"ns": t.getFullName(), "query.count": t.getName()});
-assert(current);
-countOp = current.inprog[0];
-assert(countOp);
-
-db.killOp(countOp.opid);
-res = thr.returnData();
+}
+var res = getKilledCount();
assert(res);
assert(res.match(/count failed/) !== null);
assert(res.match(/\"code\"/) !== null);
+
+s();
+