Skip to content

fix(tests): Add delay to stabilize file sync conflict test - #671

Merged
anon-pradip merged 1 commit into
mainfrom
test/wait-5-seconds-for-updating-file
Nov 12, 2025
Merged

anon-pradip merged 1 commit into
mainfrom
test/wait-5-seconds-for-updating-file

Conversation

@anon-pradip

@anon-pradip anon-pradip commented Nov 10, 2025 •

Copy link
Copy Markdown
Contributor

The test scenario Syncing a file from the server and creating a conflict is flaky due to a race condition.

The client's file watcher requires a brief moment to detect local file changes made by the test script. If the sync resumes immediately, the sync process can start before the client is aware of the local change, leading to a failure in detecting the intended conflict.

This change introduces a 5-second delay to make the test robust. The delay is strategically placed immediately before the sync is resumed. This placement is critical, as it ensures the client has the correct state information before it begins the synchronization that will lead to the conflict.

Placing the delay any later (e.g., before the final assertion) would be ineffective, as the sync would have already completed and the conflict would have been missed.

The sequence needs to be:

Upload to server → WAIT (let server settle) → Resume sync (engine detects conflict) → Check UI

Not:

Upload to server → Resume sync (engine might miss conflict) → WAIT → Check UI (shows no conflict)


Failing CIs:

@anon-pradip anon-pradip self-assigned this Nov 10, 2025
@anon-pradip
anon-pradip force-pushed the test/wait-5-seconds-for-updating-file branch 2 times, most recently from 47e22b3 to e215ec8 Compare November 11, 2025 05:05
@anon-pradip anon-pradip changed the title test: wait for 5 seconds for update file content fix(tests): Add delay to stabilize file sync conflict test Nov 11, 2025
@anon-pradip
anon-pradip marked this pull request as ready for review November 11, 2025 05:45
Comment thread test/gui/shared/steps/sync_context.py Resolved
@anon-pradip
anon-pradip force-pushed the test/wait-5-seconds-for-updating-file branch from e215ec8 to 2a2391d Compare November 12, 2025 09:37
@anon-pradip
anon-pradip force-pushed the test/wait-5-seconds-for-updating-file branch from 2a2391d to 7f0ab61 Compare November 12, 2025 09:42
@anon-pradip
anon-pradip merged commit f9fc551 into main Nov 12, 2025
@anon-pradip
anon-pradip deleted the test/wait-5-seconds-for-updating-file branch November 12, 2025 12:10
@anon-pradip anon-pradip mentioned this pull request Nov 12, 2025
9 of 10 tasks
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