[SERVER-43691] Cannot run individual tests in repltests.cpp Created: 27/Sep/19  Updated: 29/Oct/23  Resolved: 01/Oct/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2019-10-07
Participants:

 Description   

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


 Comments   
Comment by Githook User [ 01/Oct/19 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: SERVER-43691 Make repltests.cpp tests independent
Branch: master
https://github.com/mongodb/mongo/commit/cd5a510974d939860046e29fd4cdcaf41c921f26

Generated at Thu Feb 08 05:03:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.