Skip to content

Commit fb9f031

Browse files
committed
ui-smoke: settle after homing before requesting AUTO
The driver requested AUTO the instant homing completed per NML stat, but gmoccapy only enables AUTO once it has processed the all-homed signal in its own event loop (and re-asserts MANUAL itself on that signal). The early request was rejected, bounced back to MANUAL with an "It is not possible to change to Auto Mode" warning that lingered in the confirm shot; ensure_mode retried and won, so the run still passed. A short settle after homing lets the GUI catch up, so AUTO is accepted first try.
1 parent ed982e5 commit fb9f031

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/ui-smoke/_lib/drive.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
# stability check catches that.
3333
STATE_STABILITY_S = 0.5
3434
STATE_RETRY_BUDGET = 6
35+
# Pause after homing before requesting AUTO. gmoccapy only enables AUTO
36+
# once it has processed the all-homed signal in its own event loop (and
37+
# re-asserts MANUAL itself on that signal). Requesting AUTO before then is
38+
# rejected: it bounces back to MANUAL with an "It is not possible to
39+
# change to Auto Mode" warning. ensure_mode would retry and win, but the
40+
# warning lingers on screen; this settle lets the GUI catch up first.
41+
POST_HOME_SETTLE_S = 2.0
3542

3643
# linuxcnc launcher PID, written to linuxcnc.pid by the launcher and read
3744
# once at startup. The driver watches it so a GUI crash, which tears
@@ -297,6 +304,11 @@ def run_program(cmd, stat, ngc_path, expect_delta_mm, tol, run_timeout):
297304
if not home_all(cmd, stat, timeout=60.0):
298305
return False
299306

307+
# Let the GUI react to the all-homed transition before requesting AUTO,
308+
# so it does not reject the mode change (see POST_HOME_SETTLE_S).
309+
time.sleep(POST_HOME_SETTLE_S)
310+
stat.poll()
311+
300312
if not ensure_mode(cmd, stat, linuxcnc.MODE_AUTO, "MODE_AUTO"):
301313
return False
302314

0 commit comments

Comments
 (0)