Skip to content

flake: DownloaderTest/CancelledInner coder-desktop-windows #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spikecurtis opened this issue Apr 29, 2025 · 0 comments · Fixed by coder/coder-desktop-windows#81
Closed
Assignees
Labels

Comments

@spikecurtis
Copy link

   Failed CancelledInner [2 s]
  Error Message:
   TearDown : System.IO.IOException : The process cannot access the file '.test.download-dhacwhw4.3uz' because it is being used by another process.
  Stack Trace:
  --TearDown
   at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel)
   at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
   at Coder.Desktop.Tests.Vpn.Service.DownloaderTest.TearDown() in D:\a\coder-desktop-windows\coder-desktop-windows\Tests.Vpn.Service\DownloaderTest.cs:line 236
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

seen here: https://github.com/coder/coder-desktop-windows/runs/41328916991

@spikecurtis spikecurtis self-assigned this Apr 29, 2025
spikecurtis added a commit to coder/coder-desktop-windows that referenced this issue Apr 30, 2025
Fixes coder/internal#598

There is a possible race where if the cancellation token is expired, `Download()` never gets called and the tempFile is never disposed of (at least until GC). We also switch to synchronous IO so that a pending overlapped write won't block the deletion.

These issues can cause races in our tests when we try to clean up the directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant