Repository navigation
ci: Wait out a share lock when replacing a file on Windows - #221
Merged
Merged
Conversation
Replacing a file on Windows fails with a sharing violation while the virus scanner or the indexer still holds the one it replaces, which is often the case a moment after it was written: the Windows CI job saw a settings save fail right after the previous one, and a user's save would "sometimes" do nothing the same way. The atomic write now retries a few times over about half a second before giving up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
MSVC's <thread> did not compile beside the Qt and Windows headers the test already includes; QThread does the same job. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
tst_settings::fileStoreReadsWritesAndWatchesfailed on the Windows job of #220 and passed on the same code in #217: the second atomic write, issued right after the first, hit a sharing violation while the just-written file was still held by the virus scanner or the indexer. That is not a test problem — a user saving settings on Windows would see the same save silently fail.FileStore::writenow retries the atomic replace on Windows, eight attempts over about half a second, before reporting the error. A new Windows-only test holds the target open without sharing for 120ms from another thread and expects the write to land.🤖 Generated with Claude Code