Skip to content

Commit 435407e

Browse files
nabijaczlewelirincebrain
authored andcommitted
Fix test-runner on FreeBSD
CLOCK_MONOTONIC_RAW is only a thing on Linux and macOS. I'm not actually sure why the previous hardcoding of a constant didn't error out, but when we removed it, it sure does now. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Co-authored-by: Rich Ercolani <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #12995
1 parent 07a2ba5 commit 435407e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test-runner/bin/test-runner.py.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ from subprocess import PIPE
3333
from subprocess import Popen
3434
from subprocess import check_output
3535
from threading import Timer
36-
from time import time, CLOCK_MONOTONIC_RAW
36+
from time import time, CLOCK_MONOTONIC
3737
from os.path import exists
3838

3939
BASEDIR = '/var/tmp/test_results'
@@ -62,7 +62,7 @@ clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)]
6262

6363
def monotonic_time():
6464
t = timespec()
65-
if clock_gettime(CLOCK_MONOTONIC_RAW, ctypes.pointer(t)) != 0:
65+
if clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(t)) != 0:
6666
errno_ = ctypes.get_errno()
6767
raise OSError(errno_, os.strerror(errno_))
6868
return t.tv_sec + t.tv_nsec * 1e-9

0 commit comments

Comments
 (0)