Skip to content

Only DeleteOnClose when running under Windows for global lock - #431

Merged
joelverhagen merged 1 commit into
devfrom
jver-fixlock
Mar 30, 2016
Merged

joelverhagen merged 1 commit into
devfrom
jver-fixlock

Conversation

@joelverhagen

Copy link
Copy Markdown
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
Copy Markdown

LGTM


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

Copy link
Copy Markdown
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
Copy Markdown
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

alpaix commented Mar 30, 2016

Copy link
Copy Markdown
Contributor

🆒

@emgarten

Copy link
Copy Markdown
Member

:shipit:

@joelverhagen
joelverhagen force-pushed the jver-fixlock branch 2 times, most recently from a7fc20d to 42be446 Compare March 30, 2016 21:05

Copy link
Copy Markdown
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
Copy Markdown
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