Skip to content
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

Flaky tests due to Kestrel engine #584

Closed
Kaliumhexacyanoferrat opened this issue Dec 9, 2024 · 1 comment · Fixed by #586
Closed

Flaky tests due to Kestrel engine #584

Kaliumhexacyanoferrat opened this issue Dec 9, 2024 · 1 comment · Fixed by #586
Assignees
Labels
bug Something isn't working priority High-priority feature on our roadmap
Milestone

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

Since we introduced Kestrel we randomly have errors such as this one in the CI build:

  Failed TestContentNotInvalidated (Kestrel) [11 ms]
  Error Message:
   Test method GenHTTP.Testing.Acceptance.Modules.ServerCaching.ServerCacheTests.TestContentNotInvalidated threw exception: 
System.IO.IOException: The process cannot access the file '/tmp/tmpfzmlsq.tmp' because it is being used by another process.
  Stack Trace:
      at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.File.Create(String path, Int32 bufferSize, FileOptions options)
   at GenHTTP.Testing.Acceptance.Utilities.FileUtil.WriteTextAsync(String path, String content) in /home/runner/work/GenHTTP/GenHTTP/Testing/Acceptance/Utilities/FileUtil.cs:line 18
   at GenHTTP.Testing.Acceptance.Modules.ServerCaching.ServerCacheTests.TestContentNotInvalidated(TestEngine engine) in /home/runner/work/GenHTTP/GenHTTP/Testing/Acceptance/Modules/ServerCaching/ServerCacheTests.cs:line 71
   at GenHTTP.Testing.Acceptance.Modules.ServerCaching.ServerCacheTests.TestContentNotInvalidated(TestEngine engine) in /home/runner/work/GenHTTP/GenHTTP/Testing/Acceptance/Modules/ServerCaching/ServerCacheTests.cs:line 76
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added bug Something isn't working priority High-priority feature on our roadmap labels Dec 9, 2024
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat self-assigned this Dec 11, 2024
@Kaliumhexacyanoferrat
Copy link
Owner Author

Probably a race condition where we write the last bytes (of the known content length) to the output stream, Kestrel flushes them, the test continues its execution and then the disposal of the file stream (and its handle) happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority High-priority feature on our roadmap
Projects
None yet
1 participant