Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ def test_replica_set_sts_should_exist(self):
sts = self.appsv1.read_namespaced_stateful_set(RESOURCE_NAME, self.namespace)
assert sts

@pytest.mark.flaky(reruns=10, reruns_delay=3)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that test is racy

def test_sts_update(self):
sts = self.appsv1.read_namespaced_stateful_set(RESOURCE_NAME, self.namespace)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def mongo_tester(mdb: MongoDB):
def mdb_health_checker(mongo_tester: MongoTester) -> MongoDBBackgroundTester:
return MongoDBBackgroundTester(
mongo_tester,
allowed_sequential_failures=1,
Comment thread
nammn marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assert_connectivity method of MongoDBBackgroundTester attempts a write operation. Should we start considering asserting reads instead?
We already expect writes to be down during re-elections, we might as well assert something that we expect to work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm fair point, but at the same time we don't expect writes to be down the whole migration, just for some amount of time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but the issue is that the downtime intervals are not deterministic. There can be one or N re-elections, we won't know until optimize the restart order. So from a testing standpoint, while there are any pods which are restarting, the writes will not be deterministically available

allowed_sequential_failures=5,
health_function_params={
"attempts": 1,
"write_concern": pymongo.WriteConcern(w="majority"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def mongod_tester(sc: MongoDB) -> MongoTester:
def mdb_health_checker(mongod_tester: MongoTester) -> MongoDBBackgroundTester:
return MongoDBBackgroundTester(
mongod_tester,
# After running multiple tests, it seems that on sharded_cluster version changes we have more sequential errors.
allowed_sequential_failures=5,
health_function_params={
"attempts": 1,
Expand Down