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

Timing-related failures #4

Closed
eserte opened this issue May 14, 2016 · 3 comments
Closed

Timing-related failures #4

eserte opened this issue May 14, 2016 · 3 comments

Comments

@eserte
Copy link

eserte commented May 14, 2016

The following fail looks like it's timing related:

#   Failed test 'successful default UTC parse: 3 months, 7 days'
#   at t/datetime-parse.t line 104.
#          got: '2016-08-14 17:37:00.000 UTC'
#     expected: '2016-08-14 17:36:59.000 UTC'

#   Failed test 'successful UTC parse: -2 years'
#   at t/datetime-parse.t line 100.
#          got: '2014-05-14 17:37:01.000 UTC'
#     expected: '2014-05-14 17:37:00.000 UTC'

#   Failed test 'successful default UTC parse: -2 years'
#   at t/datetime-parse.t line 104.
#          got: '2014-05-14 17:37:01.000 UTC'
#     expected: '2014-05-14 17:37:00.000 UTC'
# Looks like you failed 3 tests of 1681.
t/datetime-parse.t ..... 
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/1681 subtests 
    (1 TODO test unexpectedly succeeded)
t/datetime.t ........... ok
@barefootcoder
Copy link
Owner

Yeah, I knew about these and I have a vague plan for fixing them. This should be fixed with the next release, hopefully. Thx for opening an official issue for it.

barefootcoder added a commit that referenced this issue May 22, 2016
… issues

this is to address GitHub #4 (and numerous CPAN Testers failures)
had to rearrange some existing tests (and also some comments)
refactored the three-way equivalency test in t/datetime.t to use the new func
also added comment doco to old func (`compare_times`) and new func (`generate_times_and_compare`)
@barefootcoder
Copy link
Owner

Okay, I have a new test function which can compare datetimes up to 10 times in the hopes that they'll match at least one of those times. I was doing this before in the one place I had realized I might have this problem, but now I've centralized it into a test utility function. This way, if we find more places where timing is an issue, it's (fairly) easy to convert to using this function. Or, if we find that 10 times isn't enough, it's trivial to increase that (or maybe find a better approach than brute force).

Hopefully this fixed the problem, but I'm going to give CPAN Testers a little while to chew on it before I close the issue.

@barefootcoder
Copy link
Owner

I think this issue is sufficiently corrected. I'm going to close it out now.

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

No branches or pull requests

2 participants