[SERVER-48421] Assert addShard command succeeds in jstests/sharding/auth.js test Created: 26/May/20  Updated: 29/Oct/23  Resolved: 28/May/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Task Priority: Minor - P4
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-06-01
Participants:
Linked BF Score: 18

 Description   

The jstests/sharding/auth.js test doesn't directly assert the addShard command succeeded. It instead relies on awaitRSClientHosts() to ensure mongos eventually starts opening connections to the "d2" shard. We've historically seen the addShard command fail due to an NetworkInterfaceExceededTimeLimit error and manifest as an assert.soon() failure.

Adding an assert.commandWorked() would make the manifestation of these failures in Evergreen more obvious.

print("adding shard " + shardName);
login(adminUser);
print("logged in");
result = s.getDB("admin").runCommand({addShard: shardName});
 
awaitRSClientHosts(s.s, d1.nodes, {ok: true});
awaitRSClientHosts(s.s, d2.nodes, {ok: true});



 Comments   
Comment by Githook User [ 28/May/20 ]

Author:

{'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}

Message: SERVER-48421 Assert addShard command succeeds in sharding/auth.js.
Branch: master
https://github.com/mongodb/mongo/commit/75848807828373014580ad0e54e76a4aa948a351

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