Skip to content

Commit 17b2ae0

Browse files
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 063daa8 commit 17b2ae0

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
@@ -32,7 +32,7 @@ from select import select
3232
from subprocess import PIPE
3333
from subprocess import Popen
3434
from threading import Timer
35-
from time import time, CLOCK_MONOTONIC_RAW
35+
from time import time, CLOCK_MONOTONIC
3636

3737
BASEDIR = '/var/tmp/test_results'
3838
TESTDIR = '/usr/share/zfs/'
@@ -59,7 +59,7 @@ clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)]
5959

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

0 commit comments

Comments
 (0)