From 17b2ae0b24d487fdda2ef1098ec26fa7f79a61f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sat, 22 Jan 2022 00:37:46 +0100 Subject: [PATCH] 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 Reviewed-by: Brian Behlendorf Co-authored-by: Rich Ercolani Signed-off-by: Rich Ercolani Closes #12995 --- tests/test-runner/bin/test-runner.py.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-runner/bin/test-runner.py.in b/tests/test-runner/bin/test-runner.py.in index 304494083c75..3c0b82a311bb 100755 --- a/tests/test-runner/bin/test-runner.py.in +++ b/tests/test-runner/bin/test-runner.py.in @@ -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/' @@ -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