mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #1137] [MERGED] Fix async test failures after xunit v3 upgrade #1571
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?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1137
Author: @Copilot
Created: 1/16/2026
Status: ✅ Merged
Merged: 1/16/2026
Merged by: @adamhathcock
Base:
adam/upgrade-xunit← Head:copilot/sub-pr-1136📝 Commits (5)
75cc368Initial plan2906529Fix ReaderFactory.OpenAsyncReader to use async IsArchiveAsync methodse919930Fix Archive async tests to not use AsyncOnlyStream (archives need seekable streams)c7da19fFormat code with CSharpier0de5c59Restore AsyncOnlyStream in archive async tests as requested📊 Changes
13 files changed (+48 additions, -37 deletions)
View changed files
📝
src/SharpCompress/Readers/ReaderFactory.cs(+13 -5)📝
tests/SharpCompress.Test/Ace/AceReaderAsyncTests.cs(+3 -3)📝
tests/SharpCompress.Test/Arj/ArjReaderAsyncTests.cs(+4 -4)📝
tests/SharpCompress.Test/GZip/AsyncTests.cs(+4 -4)📝
tests/SharpCompress.Test/GZip/GZipReaderAsyncTests.cs(+2 -2)📝
tests/SharpCompress.Test/ProgressReportTests.cs(+1 -1)📝
tests/SharpCompress.Test/Rar/RarReaderAsyncTests.cs(+5 -5)📝
tests/SharpCompress.Test/ReaderTests.cs(+1 -1)📝
tests/SharpCompress.Test/Tar/TarArchiveAsyncTests.cs(+4 -1)📝
tests/SharpCompress.Test/Tar/TarReaderAsyncTests.cs(+5 -5)📝
tests/SharpCompress.Test/WriterTests.cs(+1 -1)📝
tests/SharpCompress.Test/Zip/Zip64AsyncTests.cs(+1 -1)📝
tests/SharpCompress.Test/Zip/ZipReaderAsyncTests.cs(+4 -4)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.