-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Time is not monotonic on macOS runner #820
Comments
Hello @tysonite, |
@tysonite During the investigation, I found that issue most probably related to MacOS time synchronization(using sntp). I'm trying to find a way how to disable time synchronization for MacOS at all, to test how it works without sync. |
We use Github Actions to run unit/acceptance tests for Robot Framework project, sometimes, tests fail due to that issue, and it is just weird. The test verifies that elapsed time is not negative, and the mitigation on Robot Framework side is clear, it is only needed to remove such check. But the removal of check may lead to potential errors, and we would like to avoid that. Example of test failure: https://condescending-banach-9beeb5.netlify.app/log.html#s1-s12-s7-t25-k1-k4-k1 EDIT: Btw, sometimes, similar issue happens on Windows, but I can't reproduce it with a simple script. |
@tysonite We've found a workaround for the issue on MacOS agent, to reach our goal, it is required to disable time synchronisation using the following commands in runtime:
Please try this solution on your side. We are looking forward to your reply. |
Thanks, @Darleev, I will report back if any issues. |
@tysonite could you please provide us with results of your tests? Are they successful? |
I merged PR robotframework/robotframework#3571 by @tysonite with these fixes and results are here: There's some macOS failure but apparently it's something different and @tysonite already reported it as #841. No time related failures this time, but these failures have been flaky so one successful run doesn't guarantee anything. We just made a release and there are no planned code changes right now that would kick a new run. Should we start one manually to see how it goes? You can obviously do that yourself if you can. |
@pekkaklarck Thank you for an update. I have already verified that the workaround works fine . Just in case I will perform additional test, python/c++ to make sure it's not just a coincidence. |
I also have scheduled tests running once a day here (C++ / Python): https://github.com/tysonite/test_cpython/actions. I suppose if they are fine till Monday, we could consider issue I described in the first post as fixed. However, this is only a work-around, but not a fix if I understand this right. Despite of the good results, the fix is required globally applied to all runners, probably. |
@tysonite currently, we are not planning to implement fix for the issue globally, and I can only provide the workaround. Synchronisation is out of the box MacOS feature, and it seems 1 failure for 1.000.000 attempts(every 0.0001) is expected behavior in such cases. |
I never used macOS, and you might be right. In Linux, such behavior usually means misconfiguration if either guest or host OS, e. g. https://www.redhat.com/en/blog/avoiding-clock-drift-vms In any case, thanks again for your support! |
I am not sure if this is a right repo to report this kind of issue, so please feel free to close it, but point me into the right direction.
Sometimes, we note that consequence calls to get current time of operating system return values that are not monotonically increasing. The 2nd call, for example, may return value that is less than previous one.
I can reproduce this by a simple Python script that runs on macOS github-hosted runner. See it here: https://github.com/tysonite/test_cpython/blob/master/script.py
The source of interest is:
Where
t2 - t1
may be negative sometimes which is proved by this run.I expect
t2 - t1
to be always positive, but probably this is something related to VM on which runner runs.Virtual environments affected
The text was updated successfully, but these errors were encountered: