Skip to content

Conversation

obrok
Copy link
Contributor

@obrok obrok commented Feb 23, 2015

ScheduledTask measured Time.now in 2 places with some computation in
between and it sometimes arrived at an inconsistent result.

Sorry for the ugly spec - this is basically the way I reproduced it and I didn't want to bind too much to the implementation by stubbing out TimerSet.calculate_schedule_time with a sleep.

Also - it only happened on jruby for me - maybe the clock is more accurate?

ScheduledTask measured Time.now in 2 places with some computation in
between and it sometimes arrived at an inconsistent result
@jdantonio
Copy link
Member

Many of our tests are ugly, but sometimes that the only way to truly test this library. I'd be afraid of any concurrency library that used too many test doubles. If your spec revealed the problem and verified the solution it's good for me!

jdantonio added a commit that referenced this pull request Feb 23, 2015
Fix ScheduledTask sometimes not accepting an interval of 0
@jdantonio jdantonio merged commit b0fbc4e into master Feb 23, 2015
@jdantonio jdantonio deleted the zero-interval branch February 24, 2015 19:04
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