Skip to content

Exclude System.IO.Compression async tests from wasm #114769

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
carlossanlop opened this issue Apr 17, 2025 · 5 comments · Fixed by #114798
Closed

Exclude System.IO.Compression async tests from wasm #114769

carlossanlop opened this issue Apr 17, 2025 · 5 comments · Fixed by #114798
Assignees
Labels
arch-wasm WebAssembly architecture area-System.IO.Compression Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Apr 17, 2025

The newly added async tests in System.IO.Compression and System.IO.Compression.ZipFile are passing in all platforms and architectures except in the wasm libraries tests. They throw 'PlatformNotSupportedException' with the message 'Cannot wait on monitors on this runtime' which seems to be due to async tests not playing nicely in a single threaded environment.

Because I modified the existing tests so they would run the sync and async code depending on the boolean argument, both sync and async tests are currently failing in those wasm platforms.

The fix would be to split the async tests from the sync tests and either excluding the async tests from wasm or finding a way for them to run without issues in wasm.

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1019196
Build error leg or test failing: System.IO.Compression async tests

Error Message

{
  "ErrorMessage" : "Cannot wait on monitors on this runtime",
  "BuildRetry" : false,
  "ExcludeConsoleLog" : false
}
[09:20:30] info: [FAIL] System.IO.Compression.Tests.zip_InvalidParametersAndStrangeFiles.ZipArchiveEntry_CorruptedStream_EnsureNoExtraBytesReadOrOverWritten(async: True)
[09:20:30] info: System.PlatformNotSupportedException : Cannot wait on monitors on this runtime.
[09:20:30] info:    at System.Threading.Monitor.ObjWait(Int32 millisecondsTimeout, Object obj)
[09:20:30] info:    at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout)
[09:20:30] info:    at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[09:20:30] info:    at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[09:20:30] info:    at System.Threading.Tasks.Task.InternalWaitCore(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[09:20:30] info:    at System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
[09:20:30] info:    at System.Threading.Tasks.Task`1[[System.IO.MemoryStream, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetResultCore(Boolean waitCompletionNotification)
[09:20:30] info:    at System.Threading.Tasks.Task`1[[System.IO.MemoryStream, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].get_Result()
[09:20:30] info:    at System.IO.Compression.Tests.zip_InvalidParametersAndStrangeFiles.ZipArchiveEntry_CorruptedStream_EnsureNoExtraBytesReadOrOverWritten(Boolean async)

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1019196
Error message validated: [Cannot wait on monitors on this runtime at System.IO.Compression.Tests]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 4/17/2025 9:56:24 AM UTC

Report

Build Definition Test Pull Request
1019631 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114785
1019609 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114754
1019581 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114720
1019578 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114779
1019575 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114779
1019561 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #113948
1019539 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114781
1019497 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114743
1019481 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114778
1019493 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114690
1019415 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114774
1019380 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114771
1019334 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114720
1019313 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #113948
1019196 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.Tests.WorkItemExecution #114421

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
15 15 15

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1019196
Error message validated: [Cannot wait on monitors on this runtime]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 4/17/2025 7:30:03 PM UTC

Report

Build Definition Test Pull Request
1019631 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114785
1019609 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114754
1019581 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114720
1019578 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114779
1019575 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114779
1019561 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #113948
1019539 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114781
1019497 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114743
1019481 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114778
1019493 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114690
1019415 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114774
1019380 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114771
1019334 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114720
1019313 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #113948
1019196 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.Tests.WorkItemExecution #114421

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
15 15 15

Report

Build Definition Test Pull Request
1020403 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114672
1020406 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114644
1020310 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #111292
1020300 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114777
1020296 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution
1020275 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution
1020201 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114672
1020196 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114814
1020150 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114048
1020146 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114675
1019823 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114756
1020126 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114811
1020108 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #113956
1020092 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114644
1019561 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #113948
1019817 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114801
1020072 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114757
1020045 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114810
1020023 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114060
1019578 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114779
1019924 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution
1019914 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114758
1019883 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114792
1019858 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114688
1019855 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114805
1019847 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114804
1019841 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114802
1019836 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution
1019813 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114800
1019782 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114285
1019769 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114796
1019762 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114795
1019695 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114060
1019722 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114791
1019666 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114787
1019656 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114672
1019644 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114786
1019634 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #110472
1019631 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114785
1019609 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114754
1019581 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114720
1019575 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114779
1019539 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114781
1019497 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114743
1019481 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114778
1019493 dotnet/runtime WasmTestOnFirefox-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114690
1019415 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114774
1019380 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114771
1019334 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #114720
1019313 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.ZipFile.Tests.WorkItemExecution #113948
1019196 dotnet/runtime WasmTestOnChrome-ST-System.IO.Compression.Tests.WorkItemExecution #114421

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
43 51 51
@carlossanlop carlossanlop added arch-wasm WebAssembly architecture Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm labels Apr 17, 2025
@carlossanlop carlossanlop self-assigned this Apr 17, 2025
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 17, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.

@carlossanlop carlossanlop removed the untriaged New issue has not been triaged by the area owner label Apr 17, 2025
@stephentoub
Copy link
Member

Why are the zip file tests ever blocking on monitors? Which tests?

@stephentoub
Copy link
Member

Why are the zip file tests ever blocking on monitors? Which tests?

I see some of them quoted in the issue. This isn't an issue with wasm, it's an issue at a minimum with how the tests are written, e.g.
https://github.com/dotnet/runtime/blob/2e8ea867980da8331e821c0e1cb1c6cf89656ede/src/libraries/System.IO.Compression/tests/ZipArchive/zip_InvalidParametersAndStrangeFiles.cs#L286C35-L286C49
e.g.
https://github.com/dotnet/runtime/blob/2e8ea867980da8331e821c0e1cb1c6cf89656ede/src/libraries/System.IO.Compression/tests/ZipArchive/zip_InvalidParametersAndStrangeFiles.cs#L286C35-L286C49
doing

MemoryStream stream = PopulateStream().Result

instead of

MemoryStream stream = await PopulateStream();

@carlossanlop
Copy link
Member Author

Oh, that's it. I couldn't find that . Result so I thought it was something else about async code causing this issue. Making that line await should make the failure go away.

I did learn about .Result being a cause for such exception based on this S.O. thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-System.IO.Compression Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants