Skip to content

Commit

Permalink
Fix test-runner on FreeBSD
Browse files Browse the repository at this point in the history
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 <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes openzfs#12995
  • Loading branch information
nabijaczleweli authored and nicman23 committed Aug 22, 2022
1 parent df4da96 commit e4e5041
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test-runner/bin/test-runner.py.in
Expand Up @@ -32,7 +32,7 @@ from select import select
from subprocess import PIPE
from subprocess import Popen
from threading import Timer
from time import time, CLOCK_MONOTONIC_RAW
from time import time, CLOCK_MONOTONIC

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

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

0 comments on commit e4e5041

Please sign in to comment.