Skip to content

Comments

use File.OpenRead instead of File.Open in tests to allow concurrent access#895

Merged
adamhathcock merged 1 commit intoadamhathcock:masterfrom
Morilli:fix-test-concurrency
Feb 11, 2025
Merged

use File.OpenRead instead of File.Open in tests to allow concurrent access#895
adamhathcock merged 1 commit intoadamhathcock:masterfrom
Morilli:fix-test-concurrency

Conversation

@Morilli
Copy link
Contributor

@Morilli Morilli commented Feb 11, 2025

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.

Copy link
Owner

@adamhathcock adamhathcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I didn't clock this.

@adamhathcock adamhathcock merged commit 96b34ae into adamhathcock:master Feb 11, 2025
2 checks passed
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