[SERVER-23704] shard_keycount.js does not invoke anonymous function Created: 14/Apr/16  Updated: 18/Nov/16  Resolved: 14/Apr/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.2.0-rc1
Fix Version/s: 3.2.6, 3.3.5

Type: Bug Priority: Major - P3
Reporter: Kevin Pulo Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: test-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-23728 Enable the no-unused-expressions ESLi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Participants:

 Description   

This causes the jstest to accidentally not be run, and so always pass.

https://github.com/mongodb/mongo/blob/r3.3.4/jstests/sharding/shard_keycount.js#L46

Just needs

diff --git a/jstests/sharding/shard_keycount.js b/jstests/sharding/shard_keycount.js
index 9a63a2c..893e201 100644
--- a/jstests/sharding/shard_keycount.js
+++ b/jstests/sharding/shard_keycount.js
@@ -43,4 +43,4 @@
 
     s.stop();
 
-});
+})();

Command where this was noticed (this seems to be the only occurrence, but I didn't check thoroughly)

for i in `grep -l '^(function *()' jstests/*/*`; do echo; echo "$i"; tail -1 "$i"; done

cc kamran.khan



 Comments   
Comment by Githook User [ 15/Apr/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-23704 Make shard_keycount.js invoke the anonymous test function

(cherry picked from commit 8fc79125bb85c8939bd6aa4050fec29de79399d5)
Branch: v3.2
https://github.com/mongodb/mongo/commit/df35458a85c99c3838858cd3981fda1ba4ddd2a7

Comment by Githook User [ 14/Apr/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-23704 Make shard_keycount.js invoke the anonymous test function
Branch: master
https://github.com/mongodb/mongo/commit/8fc79125bb85c8939bd6aa4050fec29de79399d5

Comment by Kamran K. [ 14/Apr/16 ]

Thanks, kevin.pulo. We can catch bugs like this in the future by enabling this ESLint rule: http://eslint.org/docs/rules/no-unused-expressions (SERVER-23728)

Generated at Thu Feb 08 04:04:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.