Repository navigation
tests, task: fix load-dependent test failures - #4674
grandixximo wants to merge 8 commits into
Conversation
touchy_postgui.hal links touchy_test pins, but the panel was loaded without -W. Under load the pins did not exist yet and touchy exited. Part of LinuxCNC#4669.
xwininfo -tree also lists unmapped windows, so under load window-fit measured touchy at its creation size. Poll for a viewable window of stable size. Part of LinuxCNC#4669.
Whether the canon commands queued by interpreter init and the startup code reach motion depended on how fast the UI sent its first command. Wait for RCS_DONE (the dwell in startup-gcode-abort) and expect them. Part of LinuxCNC#4669.
halcmd's hal_init() after fork races the loaded module for the next uspace id, so the owner column changed under load. Mask it as the mb2hal tests do. Part of LinuxCNC#4669.
…ine on ESTOP_RESET leaves traj enabled, so task keeps reporting ON and the retry after a slow first homing attempt could never succeed. Part of LinuxCNC#4669.
|
Thanks for taking this on! And a good idea to use taskset, so I don't have to reboot my VM between compile and testruns. Would it be worth creating a I was not shure if INTERP_IDLE is the right state... I don't know these parts of linuxcnc well (yet). I pulled your commits in and will run paralell tests for a few hours. Until now, it looks good! Exept one test that went under in the noise, see: #4669 (comment) |
|
Caught a new one: Probably an when the ID changes from 10 to 9.
|
The owner column is right-aligned, so an id below 10 gets one more leading space and still failed the diff. Reported by Hannes Diethelm. Part of LinuxCNC#4669.
Motion flags a G38.2/G38.4 move that ended without contact one servo cycle after the planner goes idle. Task could read that cycle as DONE, finish the MDI command and miss the error, which linuxcncrsh then returned for the next command. Wait for emcmotStatus.probing to clear. Part of LinuxCNC#4669.
A 100 deep fifo holds 99 samples, and the 100 line input was preloaded with a fixed 0.5s sleep, so a late halstreamer left the streamer empty and shifted the end of the output. Use deeper fifos and loadusr -w. Part of LinuxCNC#4669.
|
Pushed three more commits: the hal-show padding fix, multiclick/mux, and a task fix for linuxcncrsh (see description). |
| loadrt sampler depth=128 cfg=bbbbbbbbbsbbbbbbbbbs | ||
| loadrt streamer depth=128 cfg=bb |
There was a problem hiding this comment.
This is essentially a bug in the streamer/sampler interface in HAL.
When a buffer is requested of size N, then you should be able to put N elements in it. The bug causes only N-1 elements to be available.
The hal_stream* code should be fixed to allocate a buffer of sufficient size to encapsulate the requested size. But the reported max size should also just be N, regardless whether the allocation is one larger. Therefore, this is not the most trivial of fixes.
There was a problem hiding this comment.
Agreed. I fixed it in hal_lib: a stream of depth N now allocates N+1 slots, holds N samples and still reports N as maxdepth. histobinstream and latencybinstream had a +1 to work around it, which is gone now. The multiclick and mux streamers are back to depth 100, and with loadusr -w halstreamer the test would hang if a 100 deep stream still held only 99. tests/halmodule/stream asserted the old capacity, so it now fills 10 of 10.
There was a problem hiding this comment.
Seen the fix. That should do it.
This is such a specific fix that I think it needs to be in its own PR. It isn't a "test-under-load fix", but a bug in HAL stream code.
There was a problem hiding this comment.
Split out into #4678. This PR is back to streamer depth 128 for multiclick and mux, so it doesn't depend on that fix.
|
The linuxcncrsh issue, well, it was a probe error that I never was able to find and bothered only when I hit it ;-) Now that, under load, it has surfaced to be in task, that would be the right place to fix it. |
5ecf649 to
ff27e51
Compare
Part of #4669. @hdiethelm, this covers the failures you listed. I reproduced them by pinning the test and a few busy loops to one CPU (
taskset -c 7).-W, sotouchy_postgui.halcould run beforetouchy_testexisted and touchy exited. Nowloadusr -Wn touchy_test.xwininfo -treealso lists unmapped windows, so window-fit measured touchy before it was mapped. It now polls for a visible window of stable size; an oversized window still fails.INTERP_IDLEis already true whileinterp_liststill holds them, so the race stays. The test UIs now wait fors.state == linuxcnc.RCS_DONE, and the expected logs include those commands. startup-gcode-abort waits forEXEC_WAITING_FOR_DELAYinstead, since its startup code sits in a dwell.hal_init()right after fork races the loaded module for the next uspace component id. A 200 ms delay there reproduces your 13 => 11 diff. The owner column is masked together with its padding (thanks for catching the 9 vs 10 width).STATE_ESTOP_RESETwith the machine already on, and task never reports that state while traj is enabled. Forcing the first homing wait to 50 ms reproduces your log exactly.loadusr -w; the stream capacity itself is fixed in hal: a stream of depth N holds N samples #4678.emcmotStatus.probingto clear before reporting motion DONE, which costs at most one servo cycle. With a program, the same window could let task issue the next line before the probe error. A 50 cycle delay before the verdict reproduces your diff, and it passes with the fix. @BsAtHome, since this is what your linuxcncrsh probe test was hitting, I'd like your view on fixing it in task.Under load the affected tests went from failing to passing in every run (motion-logger 16/16, touchy tests 3/3 each). The full suite passes apart from blendmath and tool-frame, which don't build with GCC 14 because of
EXPORT_SYMBOL(#4673).