mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
[PR #1137] Fix async test failures after xunit v3 upgrade #1575
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/1137
State: closed
Merged: Yes
The xunit v3 upgrade exposed that async tests were not properly awaiting async operations. Tests were passing
ValueTask<IAsyncReader>directly toawait usingstatements instead of awaiting the task first, andReaderFactory.OpenAsyncReaderwas calling synchronousIsArchivemethods during format detection.Changes
ReaderFactory.OpenAsyncReaderproperly async: Changed return type toValueTask<IAsyncReader>and replaced synchronousIsArchive()calls withIsArchiveAsync()during format detectionawaitbeforeReaderFactory.OpenAsyncReader()in all async test methodsAsyncOnlyStreamin Archive async tests: Archive async tests continue to useAsyncOnlyStreamto validate that archive operations properly handle async-only streams, exposing areas where synchronous I/O is still used in async code pathsExample
Before:
After:
Known Limitations
AsyncOnlyStreamto fail. These tests intentionally expose the need for async archive opening support.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.