fix: Resolve flaky test ParseLiveQuery handle invalid websocket payload length#10241
fix: Resolve flaky test ParseLiveQuery handle invalid websocket payload length#10241AbdullahZulfiqar2005 wants to merge 2 commits intoparse-community:alphafrom
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughConvert a flaky test in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR resolves CI flakiness in the ParseLiveQuery handle invalid websocket payload length spec by removing the mixed async/done pattern and making the test’s sequencing fully async/await-driven.
Changes:
- Converted the test from
async done => { ... done() }to a pureasync () => { ... }flow. - Awaited the LiveQuery
updateevent via a Promise rather than relying on callback completion. - Replaced a detached
setTimeoutmutation/save with an awaited delay to enforce sequential execution.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c2bd02c to
483c38e
Compare
Pull Request
Issue
Closes #9272
Approach
The
ParseLiveQuery handle invalid websocket payload lengthtest was marked as flaky due to random timeout errors in the CI environment. This was caused by mixing anasyncfunction declaration with adonecallback, which confuses the testing framework and can lead to hung tests if events are delayed.Fix:
donecallback and converted the test to a standardasync/awaitflow.subscription.on('update')event listener in a Promise to ensure the test explicitly and safely awaits the event resolution.setTimeoutwith an awaited Promise delay to ensure server reconfiguration and payload simulation occur sequentially.Tasks
(No tasks apply as this is a fix to an existing test case).
Summary by CodeRabbit