-
Notifications
You must be signed in to change notification settings - Fork 349
Test function TestGetWithin randomly fails #631
Comments
@obdeijn I could not reproduce the steps you mentioned. Here is my environment: Environment
Steps
@ASzc whenever you get the chance, could you please double check? |
Looking at the code of the test and I'm not sure what the solution could be yet. For now I'll write something to rerun the TestGetWithin test as rapidly as possible, to see if I can get the reproduce the reported result. |
I haven't been able to reproduce, leaving the test going on loop for a while. I think it's still an issue, but only with the test. The I suggest we just make the equality assertion in the test fuzzy, e.g. equals within 1000000000 units. That way if the freak accident of rollover happens, then the test doesn't fail. I can make the PR if we agree on this solution. |
@ASzc sure, go for it. |
Marking it as enhancement as we were not able to reproduce any bug. |
This should prevent a sporadic test failure when the time.Now() value in the test initialization doesn't match with the time.Now() inside the getWithin function. Fixes #631
Test function TestGetWithin randomly fails
Summary
When I run the test suite using "make test" I sometimes run into the following failing test:
Other times it succeeds:
Environment
Expected Results
I expect the test to always succeed.
Actual Results
The test sometimes succeeds, sometimes fails.
Steps to reproduce
Run the tests a few times (see description above).
Additional Information
Looking a the test, it seems to me like this is a timing issue, which I think is undesirable for a unit test.
The text was updated successfully, but these errors were encountered: