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

Tweak some TimeHelpers specs for reliability. #1557

Merged
merged 2 commits into from
May 6, 2014

Conversation

Shadowfiend
Copy link
Member

Because of the way specs2 matchers work, calculating the expected time
in the call-by-name matcher could result in some weirdness. We now
precompute the expected time.

Can't guarantee this'll fix the issues, but I think it could help.

Because of the way specs2 matchers work, calculating the expected time
in the call-by-name matcher could result in some weirdness. We now
precompute the expected time.
3.seconds.later.getTime must beCloseTo(new Date().getTime + 3.seconds.millis, 500L)
val expectedTime = new Date().getTime + 3.seconds.millis

3.seconds.later.getTime must beCloseTo(expectedTime, 500L)
Copy link
Member

Choose a reason for hiding this comment

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

could you still increase it to 700 or so? the test pass most of the time, so I think the "old" way was doing the right thing (I think).

@Shadowfiend
Copy link
Member Author

Yeah, fair point. Bumped the time.

@fmpwizard
Copy link
Member

Thanks 👍

fmpwizard added a commit that referenced this pull request May 6, 2014
Tweak some TimeHelpers specs for reliability.
@fmpwizard fmpwizard merged commit 69ade87 into master May 6, 2014
@fmpwizard fmpwizard deleted the improve-timehelpersspec-reliability branch May 6, 2014 00:47
@fmpwizard fmpwizard added this to the 2.6-M4 milestone Jun 7, 2014
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