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

Failing test cases for race conditions in signal interruption (#123). #125

Merged
merged 3 commits into from
Nov 27, 2016

Conversation

andersio
Copy link
Member

@andersio andersio commented Nov 25, 2016

Included in #123.

Note that the test case "should interrupt concurrently" may not fail on Travis CI due to the limited concurrency. Running the test case locally should yield the expected result.

@andersio andersio changed the title Failing test cases for race conditions in signal interruption. Failing test cases for race conditions in signal interruption (#123). Nov 26, 2016
Copy link
Member

@NachoSoto NachoSoto left a comment

Choose a reason for hiding this comment

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

Nice find! How long do these tests take? Could they be changed to use Schedulers instead to avoid sleeping?

signal.observe { event in
if !hasSlept {
sema.signal()
sleep(5)
Copy link
Member

Choose a reason for hiding this comment

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

Does this artificially add 5 seconds to the test? If so, 👎 that's too high of a price to pay.

@andersio
Copy link
Member Author

andersio commented Nov 26, 2016

I don't think Scheduler suits here. TestScheduler is synchronous, while QueueScheduler is serialising.

I've tuned them down though. The post-termination event test case now stalls only for 0.125 seconds, while the concurrent interruption test case now takes only 1000 iterations with 5 second timeout on the counter.

@NachoSoto
Copy link
Member

NachoSoto commented Nov 26, 2016 via email

@andersio
Copy link
Member Author

(Just made to demonstrate the failure. Further changes will be made in #123.)

@andersio andersio merged commit 55c9537 into master Nov 27, 2016
@mdiep mdiep deleted the signal-failing-testcases branch November 27, 2016 23:02
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