-
Notifications
You must be signed in to change notification settings - Fork 432
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
Conversation
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.
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) |
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.
Does this artificially add 5 seconds to the test? If so, 👎 that's too high of a price to pay.
I don't think 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. |
👍
On Sat, Nov 26, 2016 at 08:19 Anders Ha ***@***.***> wrote:
I don't think Scheduler suits here. TestScheduler is synchronous, while
QueueScheduler is serialising.
I've shortened the time 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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAp2KVKKmRwN3lmNRxaIyRCb2mOZTtimks5rCFwQgaJpZM4K8wRh>
.
--
Ignacio Soto
|
b2e8b48
to
55c9537
Compare
(Just made to demonstrate the failure. Further changes will be made in #123.) |
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.