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

localhost{1,2,3}.js tests should wait for a primary to be elected before shutting down the test

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.0-rc3, 4.3.1, 4.0.20
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2, v4.0
    • Linked BF Score:
      15

      Description

      The replsets/localhost{1,2,3}.js tests start a replica set using ReplSetTest and then call the replSetInitiate command directly on the first node. They then immediately stop the ReplSetTest. Since they don't wait for a primary to actually complete its first election, it's possible that the work done inside stopSet ends up running alongside the election, which can cause things like collection validation to fail when we run consistency checks. We should wait for a primary to finish its election before shutting down the test to avoid these issues.

        Attachments

          Activity

            People

            Assignee:
            william.schultz William Schultz (Inactive)
            Reporter:
            william.schultz William Schultz (Inactive)
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: