From 435407eb5cd564ada503a61b07bf14f6f6fa42ab 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 a652d3d4a0..5c868d945a 100755 --- a/tests/test-runner/bin/test-runner.py.in +++ b/tests/test-runner/bin/test-runner.py.in @@ -33,7 +33,7 @@ from subprocess import PIPE from subprocess import Popen from subprocess import check_output from threading import Timer -from time import time, CLOCK_MONOTONIC_RAW +from time import time, CLOCK_MONOTONIC from os.path import exists BASEDIR = '/var/tmp/test_results' @@ -62,7 +62,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