Repository navigation
fix(tests): Add delay to stabilize file sync conflict test - #671
Merged
Merged
Conversation
anon-pradip
force-pushed
the
test/wait-5-seconds-for-updating-file
branch
2 times, most recently
from
November 11, 2025 05:05
47e22b3 to
e215ec8
Compare
anon-pradip
marked this pull request as ready for review
November 11, 2025 05:45
anon-pradip
requested review from
TheOneRing,
prashant-gurung899 and
saw-jan
November 11, 2025 05:45
TheOneRing
approved these changes
Nov 12, 2025
saw-jan
reviewed
Nov 12, 2025
anon-pradip
force-pushed
the
test/wait-5-seconds-for-updating-file
branch
from
November 12, 2025 09:37
e215ec8 to
2a2391d
Compare
saw-jan
approved these changes
Nov 12, 2025
anon-pradip
force-pushed
the
test/wait-5-seconds-for-updating-file
branch
from
November 12, 2025 09:42
2a2391d to
7f0ab61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test scenario
Syncing a file from the server and creating a conflictis 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: