Repository navigation
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
Open
grandixximo wants to merge 2 commits into
grandixximo wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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