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

Clear global state in VectorClockMongoDTestPrimary tearDown

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Sharding 2020-08-10

      In VectorClockMongoDTestPrimary setup the clusterRole is set to ShardServer and the replica set member state to primary. Such global state should be cleared in the tearDown because subsequent tests can depend on it.

      For instance, the gossipOut test is currently working "by hazard" because tests based on VectorClockMongoDTest fixture are always executed before VectorClockMongoDTestPrimary ones. Changing such order - e.g. by changing fixtures alphabetical order - would cause the test to break because the result depends on clusterRole.

      PS: this ticket is probably a good reason to push for a randomization of unit tests order.

            Assignee:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: