diff --git a/tests/axis-type/test-ui.py b/tests/axis-type/test-ui.py index 84efee09928..41984fcaff3 100755 --- a/tests/axis-type/test-ui.py +++ b/tests/axis-type/test-ui.py @@ -30,10 +30,14 @@ def wait_ready(timeout=20.0): fail("linuxcnc did not come up") +# a realtime host may report a late servo period; not this test's error def errors(): - err = e.poll() - if err: - fail("error: %s" % err[1]) + while True: + err = e.poll() + if not err: + return + if "Unexpected realtime delay" not in err[1]: + fail("error: %s" % err[1]) def mdi(cmd, timeout=20.0): diff --git a/tests/jog-speed-change/test-ui.py b/tests/jog-speed-change/test-ui.py index 7df224f15c3..a27fef12831 100755 --- a/tests/jog-speed-change/test-ui.py +++ b/tests/jog-speed-change/test-ui.py @@ -31,6 +31,9 @@ def drain(): if not m: break print("channel:", m) + # a realtime host may report a late servo period; not this test's error + if "Unexpected realtime delay" in m[1]: + continue if m[0] in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR): error("reported: %s" % m[1].strip()) diff --git a/tests/kins-switch/test-ui.py b/tests/kins-switch/test-ui.py index e62800c5cd7..c74fe8f8b3c 100755 --- a/tests/kins-switch/test-ui.py +++ b/tests/kins-switch/test-ui.py @@ -29,10 +29,17 @@ def joints(): def kins_type(): return int(round(hal.get_value("motion.kins-type"))) +# a realtime host may report a late servo period; not this test's error +def poll(): + while True: + m = e.poll() + if not m or "Unexpected realtime delay" not in m[1]: + return m + def drain(): said = [] while True: - m = e.poll() + m = poll() if not m: return said said.append(m) @@ -201,7 +208,7 @@ def mdi(cmd): drain() c.mdi("G12.1 P-1") c.wait_complete(30) -m = e.poll() +m = poll() if not m or m[0] not in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR): error("G12.1 P-1 was accepted") elif "non-negative" not in m[1]: @@ -214,7 +221,7 @@ def mdi(cmd): c.mdi("G12.1 P7") c.wait_complete(30) -m = e.poll() +m = poll() if not m or m[0] not in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR): error("G12.1 P7 was accepted") elif "does not name" not in m[1]: diff --git a/tests/kins-switchkins-core/test-ui.py b/tests/kins-switchkins-core/test-ui.py index 2e6595199f1..9cd0e513f0e 100755 --- a/tests/kins-switchkins-core/test-ui.py +++ b/tests/kins-switchkins-core/test-ui.py @@ -28,13 +28,15 @@ def joints(): s.poll() return tuple(round(v, 6) for v in s.joint_position[:3]) +# a realtime host may report a late servo period; not this test's error def drain(): said = [] while True: m = e.poll() if not m: return said - said.append(m[1]) + if "Unexpected realtime delay" not in m[1]: + said.append(m[1]) def wait_idle(): deadline = time.time() + 30 diff --git a/tests/linuxcncrsh/checkresult b/tests/linuxcncrsh/checkresult index 86cfdbed080..e6798dc2acd 100755 --- a/tests/linuxcncrsh/checkresult +++ b/tests/linuxcncrsh/checkresult @@ -5,7 +5,10 @@ cd "$TEST_DIR" || { echo "E: Could not change directory to '$TEST_DIR'"; exit 1; # show deviation from expected output diff -uwB expected-gcode-output gcode-output || exit 1 -diff -uwB expected-telnet-output telnet-output || exit 1 +# a realtime host may report a late servo period, which one 'get error' +# then returns in place of OK +diff -uwB expected-telnet-output \ + <(sed '/^ERROR Unexpected realtime delay/{N;N;s/.*/ERROR OK/}' telnet-output) || exit 1 # search all output for possible errors grep 'error_type' result && exit 1 diff --git a/tests/m62-m68-range/test-ui.py b/tests/m62-m68-range/test-ui.py index 4e58bef2ff4..0da0d9ddcd7 100755 --- a/tests/m62-m68-range/test-ui.py +++ b/tests/m62-m68-range/test-ui.py @@ -24,6 +24,9 @@ def errors(): error = e.poll() if not error: return out + # a realtime host may report a late servo period; not this test's error + if "Unexpected realtime delay" in error[1]: + continue print(" linuxcnc error: %s" % error[1].strip()) out.append(error[1]) diff --git a/tests/probe-queue-not-empty/test-ui.py b/tests/probe-queue-not-empty/test-ui.py index 10a9c9632ef..10ab2222392 100755 --- a/tests/probe-queue-not-empty/test-ui.py +++ b/tests/probe-queue-not-empty/test-ui.py @@ -54,11 +54,16 @@ def wait_for(what, done): sys.exit(1) time.sleep(0.001) +# servo_delay busy waits inside the servo period, so a realtime host may +# report a late period; only the other errors count. +def error(err): + if err and "Unexpected realtime delay" not in err[1]: + errors.append(err[1]) + errors = [] while True: err = e.poll() - if err: - errors.append(err[1]) + error(err) s.poll() if s.interp_state == linuxcnc.INTERP_IDLE: break @@ -69,7 +74,7 @@ def wait_for(what, done): err = e.poll() while err: - errors.append(err[1]) + error(err) err = e.poll() for msg in errors: diff --git a/tests/tlo/test-ui.py b/tests/tlo/test-ui.py index 42fe9390895..2d87b4e2037 100755 --- a/tests/tlo/test-ui.py +++ b/tests/tlo/test-ui.py @@ -213,7 +213,10 @@ def verify_tool(tool, x, y, z, a, b, c, u, v, w, diameter, front_angle, back_ang c.mdi('g43.2') c.wait_complete() +# a realtime host may report a late servo period first; skip it error = e.poll() +while error and "Unexpected realtime delay" in error[1]: + error = e.poll() if error[1] != "G43.2: No axes specified and H word missing": print("G43.2 with missing H-word did not produce expected error") print("got [%s]" % error[1]) diff --git a/tests/tp/helix-motion/test-ui.py b/tests/tp/helix-motion/test-ui.py index e62b22f3d26..b359b685ab3 100755 --- a/tests/tp/helix-motion/test-ui.py +++ b/tests/tp/helix-motion/test-ui.py @@ -27,6 +27,9 @@ def check_errors(): error = errors.poll() if error is None: return + # a realtime host may report a late servo period; not this test's error + if "Unexpected realtime delay" in error[1]: + continue if error[0] in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR): raise RuntimeError(error[1]) diff --git a/tests/workplane-preview/test-ui.py b/tests/workplane-preview/test-ui.py index e52f1759059..3b669de0e03 100755 --- a/tests/workplane-preview/test-ui.py +++ b/tests/workplane-preview/test-ui.py @@ -54,13 +54,15 @@ def say(*a): c.home(-1) l.wait_for_home(joints=[1, 1, 1, 1, 0, 0, 0, 0, 0]) +# a realtime host may report a late servo period; not this test's error def errors(): msgs = [] while True: m = e.poll() if not m: return msgs - msgs.append(m[1]) + if "Unexpected realtime delay" not in m[1]: + msgs.append(m[1]) def mdi(*cmds): c.mode(linuxcnc.MODE_MDI)