Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-48421

Assert addShard command succeeds in jstests/sharding/auth.js test

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • Sharding 2020-06-01
    • 18

      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});
      

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: