Skip to content

Fix async test failures after xunit v3 upgrade#1137

Merged
adamhathcock merged 5 commits intoadam/upgrade-xunitfrom
copilot/sub-pr-1136
Jan 16, 2026
Merged

Fix async test failures after xunit v3 upgrade#1137
adamhathcock merged 5 commits intoadam/upgrade-xunitfrom
copilot/sub-pr-1136

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

The xunit v3 upgrade exposed that async tests were not properly awaiting async operations. Tests were passing ValueTask<IAsyncReader> directly to await using statements instead of awaiting the task first, and ReaderFactory.OpenAsyncReader was calling synchronous IsArchive methods during format detection.

Changes

  • Made ReaderFactory.OpenAsyncReader properly async: Changed return type to ValueTask<IAsyncReader> and replaced synchronous IsArchive() calls with IsArchiveAsync() during format detection
  • Fixed test await patterns: Added explicit await before ReaderFactory.OpenAsyncReader() in all async test methods
  • Kept AsyncOnlyStream in Archive async tests: Archive async tests continue to use AsyncOnlyStream to validate that archive operations properly handle async-only streams, exposing areas where synchronous I/O is still used in async code paths

Example

Before:

await using var reader = ReaderFactory.OpenAsyncReader(stream); // Sync IsArchive() called internally

After:

await using var reader = await ReaderFactory.OpenAsyncReader(stream); // Async IsArchiveAsync() called

Known Limitations

  • Archive APIs: Archive opening performs synchronous I/O during format probing, causing tests with AsyncOnlyStream to fail. These tests intentionally expose the need for async archive opening support.
  • Compressed tar formats: Reader opening for compressed tar formats (tar.bz2, tar.lz, tar.gz) requires multi-step format probing not yet implemented in the async path, causing "Cannot determine compressed stream type" errors.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 16, 2026 09:12
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
…kable streams)

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tests to work with upgraded xunit v3 Fix async test failures after xunit v3 upgrade Jan 16, 2026
Copilot AI requested a review from adamhathcock January 16, 2026 09:27
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments