Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/axis-type/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 3 additions & 0 deletions tests/jog-speed-change/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
13 changes: 10 additions & 3 deletions tests/kins-switch/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]:
Expand All @@ -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]:
Expand Down
4 changes: 3 additions & 1 deletion tests/kins-switchkins-core/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/linuxcncrsh/checkresult
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/m62-m68-range/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
11 changes: 8 additions & 3 deletions tests/probe-queue-not-empty/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions tests/tlo/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
3 changes: 3 additions & 0 deletions tests/tp/helix-motion/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
4 changes: 3 additions & 1 deletion tests/workplane-preview/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading