chore(e2e-tests): wait for documents to appear on view swap before value check COMPASS-10205 #7679
+4
−0
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.
COMPASS-10205
This should hopefully fix the flake in this test, my hunch is that we were checking for the value of the document before the view had swapped which caused occasional failures.
Here are my investigation notes:
One test failed on “expected undefined to equal '"10101010"'” on line 778
compass/packages/compass-e2e-tests/tests/in-use-encryption.test.ts
Line 778 in 378e982
The other test failed on “expected [ …(4) ] to have a length of +0 but got 4” line 777
compass/packages/compass-e2e-tests/helpers/commands/read-first-document-content.ts
Line 20 in 378e982
So the field values exist, but not field names yet. I am thinking it's a the race between the two requests for the field names and field values even. (names happens first and it’s length 0).
So the
runFindOperationisn’t checking for the expected status in the respective view when the view is swapped (here it's JSON -> list view).From the screenshots, which happen after the check, it looks like it’s the right content being shown.