Skip to content

tests: wait for the machine to be on and homed, and for the abort's plane cancel - #4947

Open
grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:test-waits
Open

grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:test-waits

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Since #4833 linuxcnc.command() no longer pays 20 ms per command, and three tests that relied on that delay flake in CI:

linuxcnc_util gets wait_for_machine_on() and home_all(), and home_joints() now waits for the machine to be on first. twp-native waits for the plane to be cancelled, with a deadline, so a cancel that never comes still fails the test. A second commit moves twelve more tests that do home(-1) then MDI onto home_all(). Tests whose configs have no HOME_SEQUENCE are left alone: there home(-1) homes nothing and MDI does not need it.

Tested locally under eight busy CPU loops: on master kins-limits/box failed 1 of 10 rounds, with this change all three passed 20 of 20. The touched tests pass three rounds in a row at runtests -j 8. I could not make the twp-native failure happen locally, so that part is checked against the CI logs only.

Running the tests one at a time (RUNTEST_JOBS=1) would only make these rarer; the races are in the tests.

Fixes #4943

…ancel

Since linuxcnc.command() stopped paying 20 ms per command (LinuxCNC#4833), three
tests flake in CI:

- kins-limits/box sends mode(MDI) while the joints are still homing:
  wait_complete() after home(-1) only waits for task to pass the home on.
  Task refuses MDI and every move after fails.
- matrixkins asks to home before the machine is on, and motion refuses.
- twp-native reads g68_active right after a refused MDI, before the
  abort's plane cancel has gone through task's queue.

linuxcnc_util gets wait_for_machine_on() and home_all(), and home_joints()
now waits for the machine to be on first. twp-native waits until the plane
is cancelled, with a deadline, so a cancel that never comes still fails.

Tested in the sandbox under 8 busy-loop CPU burners: on master
kins-limits/box failed 1 of 10 rounds; with this change 20 of 20 rounds of
all three pass.
The tests below send home(-1), wait_complete() and then switch to MDI or
move, the same race kins-limits/box hit: wait_complete() returns once task
has passed the home on, not once the joints are homed. They use home_all()
now. Tests whose configs have no HOME_SEQUENCE are left as they are: there
home(-1) homes nothing and MDI does not need it.

All touched tests pass three times in a row at runtests -j 8 in the sandbox.
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.

tests: failure in tests/twp-native

1 participant