Skip to content
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

Merged
merged 1 commit into from
Mar 30, 2016

Conversation

joelverhagen
Copy link
Member

  1. Loop more in global lock stress test. This causes a global lock failure to reproduce on Mac OS X and Linux. Multiple threads get access to the same lock at the same time.
  2. Only FileOptions.DeleteOnClose when running under Windows when opening the global lock FileStream. We need to come up with a cleanup story for the other platforms.

@emgarten @yishaigalatzer @stephentoub @zhili1208 @alpaix

@stephentoub
Copy link

LGTM


// Assert
Assert.Equal(threads * iterations, results.Length);
foreach (var result in results)
Copy link
Contributor

Choose a reason for hiding this comment

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

Assert.DoesNotContain(false, results)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, nice!

@alpaix
Copy link
Contributor

alpaix commented Mar 30, 2016

🆒

@emgarten
Copy link
Member

:shipit:

@joelverhagen joelverhagen force-pushed the jver-fixlock branch 2 times, most recently from a7fc20d to 42be446 Compare March 30, 2016 21:05
var acquired = await verificationSemaphore.WaitAsync(0);
if (!acquired)
{
throw new Exception("The semaphore could not be acquired, meaning the locking mechanism is not working.");
Copy link
Contributor

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

Copy link
Member Author

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.

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.

6 participants