Skip to content

Conversation

@ScharfViktor
Copy link
Contributor

@ScharfViktor ScharfViktor commented Sep 10, 2025

image

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.

@ScharfViktor ScharfViktor changed the title fix mobile test fix mobile flaky test Sep 10, 2025
@ScharfViktor ScharfViktor marked this pull request as ready for review September 10, 2025 15:43
Copilot AI review requested due to automatic review settings September 10, 2025 15:43
Copy link
Contributor

Copilot AI left a 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.

Comment on lines +446 to 448
const respPromise = Promise.all([
page.waitForResponse((res) => res.status() === 207 && res.request().method() === 'PROPFIND')
])
Copy link

Copilot AI Sep 10, 2025

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.

Suggested change
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')

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@AlexAndBear AlexAndBear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤩

@AlexAndBear AlexAndBear merged commit 7981644 into main Sep 10, 2025
28 checks passed
@AlexAndBear AlexAndBear deleted the fixMobileTest branch September 10, 2025 16:00
@openclouders openclouders mentioned this pull request Sep 10, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants