diff options
Diffstat (limited to 'jstests/aggregation/bugs/server30084.js')
-rw-r--r-- | jstests/aggregation/bugs/server30084.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/aggregation/bugs/server30084.js b/jstests/aggregation/bugs/server30084.js new file mode 100644 index 00000000000..926b032e229 --- /dev/null +++ b/jstests/aggregation/bugs/server30084.js @@ -0,0 +1,18 @@ +/** + * Test that running a $currentOp aggregation on a cluster with no shards returns an empty result + * set, and does not cause the mongoS floating point failure described in SERVER-30084. + */ +(function() { + const st = new ShardingTest({shards: 0, config: 1}); + + const adminDB = st.s.getDB("admin"); + + assert.commandWorked( + adminDB.runCommand({aggregate: 1, pipeline: [{$currentOp: {}}], cursor: {}})); + assert.commandWorked(adminDB.currentOp()); + + assert.eq(adminDB.aggregate([{$currentOp: {}}]).itcount(), 0); + assert.eq(adminDB.currentOp().inprog.length, 0); + + st.stop(); +})();
\ No newline at end of file |