-
Notifications
You must be signed in to change notification settings - Fork 25
fix mobile flaky test #1173
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 mobile flaky test #1173
Conversation
621f5eb to
2b2b984
Compare
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.
Pull Request Overview
This PR fixes a race condition in mobile end-to-end tests when opening Collabora documents. The test was flaky because it was trying to wait for multiple asynchronous operations simultaneously with the click action, causing timing issues.
- Separates the waiting operations from the click action to ensure proper sequencing
- Waits for load state, URL change, and response only after clicking the Create button
- Fixes the Promise.all pattern around editor.close() to prevent race conditions
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const respPromise = Promise.all([ | ||
| page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND') | ||
| ]) |
Copilot
AI
Sep 10, 2025
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.
Using Promise.all() with a single promise is unnecessary. Consider directly awaiting the waitForResponse call or removing the Promise.all wrapper for clarity.
| const respPromise = Promise.all([ | |
| page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND') | |
| ]) | |
| const respPromise = page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND') |
AlexAndBear
left a comment
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.
🤩
Fix race condition when opening Collabora
Wait for load state, URL change, and response only after clicking Create button. Ensures Collabora is available before proceeding.