Skip to content

tests: close the idle-detection hole in the G28.2 sequencing test - #4570

Merged
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:g282-sequencing-race
Sep 19, 2026
Merged

BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:g282-sequencing-race

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Fixes #4569.

The failure is a hole in the test, not a task wedge. The rejected G28.2 P99 goes through task's ERROR path, which aborts, sets exec DONE and interp IDLE, and queues a resynch on the interp list. wait_idle() returns right there, and the G0 X2 sent while the resynch is still on the list gets parked in the MDI queue. A queued MDI also reads as DONE/IDLE, so the next wait_idle() returns at once and the test reads X while the move has not run yet. The window is one task cycle; the failing run logged main loops of 49 ms, which is enough.

I reproduced it by stalling milltask in gdb at the status write of the ERROR cycle: the old test fails with the exact CI message, the fixed test passes. Without the stall both pass, 10/10.

Changes, test only:

  • wait_idle() also requires queued_mdi_commands == 0.
  • The recovery check waits for X to reach 2 with a timeout instead of waiting for idle.

The rejected G28.2 P99 puts task through its ERROR path, which reports
DONE/IDLE with the resynch still on the interp list. The next MDI sent
in that window is parked in the MDI queue, and a queued MDI also reads
as DONE/IDLE, so wait_idle() returned before the move ran and the test
read X while it was still 0. One slow task cycle on a loaded CI runner
is enough to open the window.

wait_idle() now also requires queued_mdi_commands == 0, and the recovery
check waits for X to reach 2 instead of for idle.

Fixes LinuxCNC#4569
@BsAtHome
BsAtHome merged commit 8083253 into LinuxCNC:master Sep 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test fails g28.2/sequencing - Race condition?

2 participants