-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flaky test with transactions #7187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
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.
|
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
* 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
🎉 This change has been released in version 5.0.0-beta.1 |
🎉 This change has been released in version 5.0.0 |
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