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

On Suse10, the test libtest_base.so:TimerTest_BasicTimeout_Success occassionally fails #167

Closed
palladia opened this issue Jan 2, 2017 · 1 comment
Labels

Comments

@palladia
Copy link
Contributor

palladia commented Jan 2, 2017

error output:

test_timer.cpp(169):
Assert: timerTestStrand.timeoutTime-startTimeUsec >= FIFTY_MILLISECONDS_AS_USEC
(Timeout took shorter than expected)
[Failed] libtest_base.so:TimerTest_BasicTimeout_Success 0.054719

Investigations show that the actual timeout was sometimes 49.* msecs.

Although various platforms provide high-precision timers, there isn't an easy way to implement this on all platforms. See http://stackoverflow.com/questions/361363/how-to-measure-time-in-milliseconds-using-ansi-c.

Our implementation is located in pal/sleep.c. On most platforms, _POSIX_MONOTONIC_CLOCK does not appear to be > 0, so just basic gettimeofday() is used. It's not trivial to just enable clock_gettime, as many older platforms also require linking with -lrt library.

@palladia
Copy link
Contributor Author

palladia commented Feb 9, 2017

Fixed by #229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants