Skip to content

Test cases failed because sleep function is too slow on Mac #940

@ygj6

Description

@ygj6

There are many test cases related to nanosleep/usleep function. They test the performance of timing roughly similar to the following code:

gettimeofday(&start);
evutil_usleep_(100000usec);   // sleep 100000 microsecond (or 100 millisecond).
gettimeofday(&end);
diff = end - start;
assert(80000 < diff && diff < 120000); 

This code runs successfully on my own computer (Linux, Windows and Mac).
On travis-CI, it only succeeded on Linux and Windows, but not on Mac(The diff is likely to be greater than 120000).
In travis result, there are 133 failures, 124 of which are sleep related.
I guess the issue is caused by the Mac virtual machine which travis used. But there is no evidence to prove it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions