Skip to content

testfile: retry Remove on transient Windows sharing violations - #7178

Open
denik wants to merge 1 commit into
mainfrom
denik/fix-sync-overwrite-folder
Open

denik wants to merge 1 commit into
mainfrom
denik/fix-sync-overwrite-folder

Conversation

@denik

@denik denik commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Changes

testfile.TestFile.Remove retries os.Remove every 100ms for up to 10s before failing.

Why

integration/cmd/sync.TestSyncIncrementalFileOverwritesFolder flaked on azure-windows in nightly 40191415337: remove C:\...\foo\bar.txt: The process cannot access the file because it is being used by another process. (sync_test.go:399), after which the sync wait timed out. Sync closes the file before reporting completion, so the holder is most likely an external process (antivirus/indexer) holding the just-written file briefly.

Tests

go test ./libs/sync/... ./cmd/sync/...; integration test to run in CI.

This pull request and its description were written by Isaac.

On Windows CI, os.Remove on a file that was just written can fail with
"The process cannot access the file because it is being used by another
process" while another process still holds it open. This failed
TestSyncIncrementalFileOverwritesFolder (azure windows, 2026-10-25) and
the subsequent waitForCompletionMarker then timed out. Retry the removal
for a bounded time so the test does not depend on that handle being
released immediately.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik marked this pull request as ready for review October 26, 2026 09:02
@denik
denik requested a review from a team as a code owner October 26, 2026 09:02
@denik
denik requested a review from chrisst October 26, 2026 09:02
@denik
denik enabled auto-merge October 26, 2026 09:10
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6aa1472

Run: 40295185792

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 281 15 4:23
✅​ aws-windows-latest-4core-16gb 283 13 4:46
✅​ azure linux-2core-8gb 280 15 4:06
✅​ azure-windows-latest-4core-16gb 282 13 4:25
✅​ gcp linux-2core-8gb 281 15 4:01
✅​ gcp-windows-latest-4core-16gb 283 13 5:18
Top 3 slowest tests (at least 2 minutes):
duration env testname
5:12 gcp-windows-latest-4core-16gb TestAccept
4:40 aws-windows-latest-4core-16gb TestAccept
4:18 azure-windows-latest-4core-16gb TestAccept

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants