Fix flaky test with transactions#7187
Merged
davimacedo merged 6 commits intoparse-community:masterfrom Feb 18, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7187 +/- ##
==========================================
- Coverage 94.04% 84.23% -9.81%
==========================================
Files 172 172
Lines 12850 12867 +17
==========================================
- Hits 12085 10839 -1246
- Misses 765 2028 +1263
Continue to review full report at Codecov.
|
Member
Author
|
It looks we now have another flaky test because of this. I will check it out before merging. |
…w Parse Server tries to submit the transaction multilpe times in the case of TransientError
dplewis
pushed a commit
that referenced
this pull request
Feb 21, 2021
* Fix flaky test with transactions * Add CHANGELOG entry * Fix the other transactions related tests that became flaky because now Parse Server tries to submit the transaction multilpe times in the case of TransientError * Remove fit from tests
Contributor
|
🎉 This change has been released in version 5.0.0-beta.1 |
Merged
Contributor
|
🎉 This change has been released in version 5.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
New Pull Request Checklist
Issue Description
Flaky test with mongodb transactions due to transient error.
Related issue: #7180
Approach
It is a weird brute force solution but it is actually the MongoDB recommended way:
https://docs.mongodb.com/manual/core/transactions-in-applications/#core-api
Basically it recommends to retry in an infinite loop every time you get a TransientError. I limited it to 5 times. Before the fix, I testes and it failed about 1 every 100 times the test runs. Now I can run the test 10,000 with no errors.
TODOs before merging