-
-
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
test: improve transaction tests to use async/await #7759
Conversation
Thanks for opening this pull request!
|
Codecov Report
@@ Coverage Diff @@
## alpha #7759 +/- ##
==========================================
- Coverage 93.94% 93.93% -0.01%
==========================================
Files 183 183
Lines 13660 13660
==========================================
- Hits 12833 12832 -1
- Misses 827 828 +1
Continue to review full report at Codecov.
|
@mtrezza this is ready for review. @davimacedo may want to chime in my comment above. |
@mtrezza looks like we are seeing a higher probability of the test suite passing already. Will increase a little more after this PR. Note the possibility of the bug doesn't need to be fixed in this PR, but probably should be looked at in the future. |
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.
Looks good, a great clean-up!
🎉 This change has been released in version 5.0.0-alpha.17 |
🎉 This change has been released in version 5.0.0-beta.10 |
🎉 This change has been released in version 5.1.0 |
New Pull Request Checklist
Issue Description
Make the transactions tests (
ParseServerRESTController.spec.js
andbatch.spec.js
) use async await.@davimacedo I cleaned up the
ParseServerRESTController.spec.js
and ran into a problem with one of the transactions tests for mongo. I noticed in #5849 (comment) you mentioned mongo needed areplicaset
when using transactions.The problem I ran into is the extra reconfiguration of the server:
parse-server/spec/ParseServerRESTController.spec.js
Lines 348 to 349 in 191d80b
seems to override the one configuration that uses the
replicaSet
:parse-server/spec/ParseServerRESTController.spec.js
Lines 171 to 183 in 191d80b
Related issue: #7180
Approach
When I remove the extra reconfigure and use the
replicaset
one, the following failures occur on Mongo (the Mongo CI that doesn't use replicaSet seems to pass in any case):Note that removing the extra reconfigure on this test seems to work:
parse-server/spec/ParseServerRESTController.spec.js
Lines 189 to 190 in 191d80b
My initial thoughts are the extra reconfigure shouldn't be there and the tests might be catching an actual bug. I don't know enough about Mongo to know if separate sessions are required for transactions.
Also, it looks like the exact set of transaction tests are in
ParseServerRESTController.spec.js
andbatch.spec.js
(the same problem I mentioned above exists in both). The difference I see is one is using theParseServerRESTController
in tests. It seems both tests randomly fail with connection issues (I'm not able to replicate this locally) on Postgres (so I've disabled the RESTController transaction tests on Postgres to reduce the amount of random failures in the CI).parse-server/spec/batch.spec.js
Lines 170 to 590 in 4c29d4d
TODOs before merging