summaryrefslogtreecommitdiff
path: root/jstests/core
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-10-21 10:24:24 -0400
committerDavid Storch <david.storch@10gen.com>2014-10-21 10:32:59 -0400
commit011dde7e6eac3b73cb1d2a7f004feee9bed99c46 (patch)
tree32b20bc3224627c93e5781ba72abb45a1f825b37 /jstests/core
parent0bee61d26e44e26c2678d550990a57ce488f222d (diff)
downloadmongo-011dde7e6eac3b73cb1d2a7f004feee9bed99c46.tar.gz
SERVER-15541 SERVER-15652 implement timing-based yielding
Diffstat (limited to 'jstests/core')
-rw-r--r--jstests/core/queryoptimizer3.js37
1 files changed, 23 insertions, 14 deletions
diff --git a/jstests/core/queryoptimizer3.js b/jstests/core/queryoptimizer3.js
index a90c7985839..8cace47dc66 100644
--- a/jstests/core/queryoptimizer3.js
+++ b/jstests/core/queryoptimizer3.js
@@ -12,22 +12,31 @@ for( i = 0; i < 100; ++i ) {
for( j = 0; j < 100; ++j ) {
t.save({a:j,b:j});
}
- m = i % 5;
- if ( m == 0 ) {
- t.count({a:{$gte:0},b:{$gte:0}});
- }
- else if ( m == 1 ) {
- t.find({a:{$gte:0},b:{$gte:0}}).itcount();
- }
- else if ( m == 2 ) {
- t.remove({a:{$gte:0},b:{$gte:0}});
- }
- else if ( m == 3 ) {
- t.update({a:{$gte:0},b:{$gte:0}},{});
+
+ try {
+ m = i % 5;
+ if ( m == 0 ) {
+ t.count({a:{$gte:0},b:{$gte:0}});
+ }
+ else if ( m == 1 ) {
+ t.find({a:{$gte:0},b:{$gte:0}}).itcount();
+ }
+ else if ( m == 2 ) {
+ t.remove({a:{$gte:0},b:{$gte:0}});
+ }
+ else if ( m == 3 ) {
+ t.update({a:{$gte:0},b:{$gte:0}},{});
+ }
+ else if ( m == 4 ) {
+ t.distinct('x',{a:{$gte:0},b:{$gte:0}});
+ }
}
- else if ( m == 4 ) {
- t.distinct('x',{a:{$gte:0},b:{$gte:0}});
+ catch (e) {
+ print("Op killed during yield: " + e.message);
}
}
p();
+
+// Ensure that the server is still responding.
+assert.commandWorked(db.runCommand({isMaster: 1}));