Skip to content

Time is not monotonic on macOS runner #820

@tysonite

Description

@tysonite

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:

        t1 = time.time()
        time.sleep(0.001)
        t2 = time.time()

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

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Metadata

Metadata

Assignees

Labels

Area: AppleOS: macOSinvestigateCollect additional information, like space on disk, other tool incompatibilities etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions