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

Cannot run individual tests in repltests.cpp

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Repl 2019-10-07

      Running a single test like this fails:

      dbtest -f DeleteOpIsIdBased
      

      Here's how the tests work when run as a suite:

      • In the Base test constructor, we see that our test collection doesn't exist, and we create it, as well as writing an oplog entry for the "create" command
      • If the whole suite is being run, then the first test is LogBasic. It asserts there is 1 oplog entry when it begins.
      • When LogBasic ends, the Base test destructor clears the oplog.
      • Subsequent tests begin by calling the Base constructor, which sees the test collection does exist, and therefore doesn't call the "create" command. Subsequent tests assume the oplog is empty.

      But if we run one test it may fail, depending on which test it is. For example, if we run DeleteOpIsIdBased:

      • In the Base test constructor we call "create"
      • In the body of DeleteOpIsIdBased we write 2 oplog entries
      • We call applyAllOperations, which isn't designed to handle command entries like "create"
      • The test fails with an invariant

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: