Closed
Labels
bugA problem with current functionality, as opposed to missing functionality (enhancement)buildIssues caused by or requiring changes to the build system (scripts or Docker image)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Milestone
Description
Pretty much all the tests fail at cleaning up the temp dir:
...
=== RUN TestWeakHash
2023/02/07 15:28:59 INFO: No stored folder metadata for "default"; recalculating
2023/02/07 15:28:59 INFO: Ready to synchronize "default" (default) (sendreceive)
2023/02/07 15:28:59 INFO: Completed initial scan of sendreceive folder "default" (default)
testing.go:1206: TempDir RemoveAll cleanup: remove C:\Users\jb\AppData\Local\Temp\TestWeakHash1733825082\001: The process cannot access the file because it is being used by another process.
--- FAIL: TestWeakHash (2.03s)
=== RUN TestCopierCleanup
2023/02/07 15:29:01 INFO: No stored folder metadata for "default"; recalculating
2023/02/07 15:29:01 INFO: Ready to synchronize "default" (default) (sendreceive)
2023/02/07 15:29:01 INFO: Completed initial scan of sendreceive folder "default" (default)
testing.go:1206: TempDir RemoveAll cleanup: remove C:\Users\jb\AppData\Local\Temp\TestCopierCleanup3901192848\001: The process cannot access the file because it is being used by another process.
--- FAIL: TestCopierCleanup (1.44s)
...
Metadata
Metadata
Assignees
Labels
bugA problem with current functionality, as opposed to missing functionality (enhancement)buildIssues caused by or requiring changes to the build system (scripts or Docker image)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
imsodin commentedon Feb 8, 2023
Looks exactly like this, which is fixed in go1.19, and the code hasn't been changed since that fix:
golang/go#51442
calmh commentedon Feb 9, 2023
Yes though apparently it has. Our model test are quite convoluted though, especially in terms of setup and tear down, and creates
a bucketload of temporary files and directories often inside the repo. I started cleaning it up to consistently use the fakefs where possible which removes this issue.
bhasden commentedon Apr 13, 2023
For what it's worth, I was on one of the original threads where a similar bug was reported and the fix from that thread didn't resolve the issue for me. While investigating, the most likely conclusion I reached was that a file handle not being closed in the Windows file handling code related to temp directories and tests, however I ran out of time before I could pinpoint the exact line of code where the file was being left open when the temp dir cleanup was occurring. For our tests, we worked around the issue by avoiding temp dir creation at all. Based on my findings, no amount of delay or retry is going to resolve this specific Windows issue.
Caveat, although I've been programming for decades, I'm a newbie with Go. Everything I said above could be completely wrong and/or misleading.
all: Grand test refactor (fixes syncthing#8778, fixes syncthing#8779, f…
all: Grand test refactor (fixes syncthing#8779, fixes syncthing#8799)
all: Grand test refactor (fixes syncthing#8779, fixes syncthing#8799)
Merge branch 'main' into syncthingw
all: Grand test refactor (fixes syncthing#8779, fixes syncthing#8799)