ci(NODE-6519, NODE-6702): fix flaky listIndexes APM test and rtt calculation test #4464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What is changing?
Fixes two flaky tests. I can break this into two PRs if we want.
The rtt calculation test was discussed this morning at standup.
The APM test is a bit more involved. I noticed that the assertions don't really match the test description. So, I broke the test into two tests, each with a description that matches the assertions in the test.
The flakiness was caused by replication lag - the test inserted a document and attempted to immediately listIndexes on a secondary. With w: majority, it isn't guaranteed that the secondary will have received this write yet, and the test fails. I solved this by simply squashing the error that comes back from the listIndexes command. The test asserts that we correctly report the
address
on command started events when reading from secondaries, so the outcome of the command isn't relevant to the assertion in the test.Is there new documentation needed for these changes?
What is the motivation for this change?
Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript