-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only DeleteOnClose when running under Windows for global lock #431
Conversation
LGTM |
|
||
// Assert | ||
Assert.Equal(threads * iterations, results.Length); | ||
foreach (var result in results) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert.DoesNotContain(false, results)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nice!
🆒 |
a7fc20d
to
42be446
Compare
var acquired = await verificationSemaphore.WaitAsync(0); | ||
if (!acquired) | ||
{ | ||
throw new Exception("The semaphore could not be acquired, meaning the locking mechanism is not working."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't throw Exception
ever, not even in a test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can return false
here, although it seems like throwing exceptions in tests can be useful sometimes.
42be446
to
1d73fdd
Compare
FileOptions.DeleteOnClose
when running under Windows when opening the global lockFileStream
. We need to come up with a cleanup story for the other platforms.@emgarten @yishaigalatzer @stephentoub @zhili1208 @alpaix