[PR #895] use File.OpenRead instead of File.Open in tests to allow concurrent access #1322

Open
opened 2026-01-29 22:19:58 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/895

State: closed
Merged: Yes


When running all tests concurrently, it could happens that multiple tests accessed the same test file at the same time.

This should not be an issue when just reading the files, however the usage of File.Open without a FileShare parameter made the access exclusive and caused each subsequent call to fail. This was especially noticable in the Zip_Uncompressed_64bit test due to the long time it takes.

**Original Pull Request:** https://github.com/adamhathcock/sharpcompress/pull/895 **State:** closed **Merged:** Yes --- When running all tests concurrently, it could happens that multiple tests accessed the same test file at the same time. This should not be an issue when just reading the files, however the usage of `File.Open` without a `FileShare` parameter made the access exclusive and caused each subsequent call to fail. This was especially noticable in the `Zip_Uncompressed_64bit` test due to the long time it takes.
claunia added the pull-request label 2026-01-29 22:19:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1322