-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
ALL
-
v4.2, v4.0
-
15
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.