https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/5245/steps/13/logs/stdio qemuarm64-ptest ubuntu1804-arm-1 diff-{{{ --- /usr/lib/util-linux/ptest/tests/expected/script/options-size +++ /usr/lib/util-linux/ptest/tests/output/script/options-size @@ -3,7 +3,6 @@ · Script done on 2015-05-24 17:43:18+00:00 [<max output size exceeded>] Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo 2:1234567890" <not executed on terminal>] -2:1234567890 - +2:1234567890 Script done on 2015-05-24 17:43:18+00:00 [<max output size exceeded>] 1 }}}-diff FAIL: script: options: [05] size (script/options-size) FAIL: script: options (1 from 5 sub-tests)
Build move to 5.0 -- ../Randy
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/5844/steps/12/logs/stdio qemux86-64-ptest rocky9-ty-1
Both happened more than 3 months ago, closing as agreed on the triage call.
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6273/steps/12/logs/stdio Failed ptests: {'util-linux': ['script:_options:_[05]_size', 'script:_options']} qemux86-64-ptest fedora38-ty-2
Bulk move from 5.0* to 5.99 to indicate that there isn't any one available to work on this issue.
https://autobuilder.yoctoproject.org/typhoon/#/builders/81/builds/6937/steps/12/logs/stdio qemux86-64-ptest debian12-ty-1
Not seen in about 8 months.
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/227/steps/12/logs/stdio Failed ptests:{'util-linux': ['script:_options:_[05]_size', 'script:_options']} qemuriscv64-ptest ubuntu2204-vk-2 Reopening.
Valid reopen
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/696/steps/13/logs/stdio Failed ptests:{'util-linux': ['script:_options:_[05]_size', 'script:_options']} qemuriscv64-ptest ubuntu2404-vk-3
One of the many AB-INT bugs that would be nice to have soemeone fix. Please assign it to yourself if you are able to start working on it. Feel free to ask questions once you've taken a look at the data and code.
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/833/steps/13/logs/stdio Failed ptests:{'util-linux': ['script:_options:_[05]_size', 'script:_options']} qemuriscv64-ptest debian12-vk-4
I've picked this up and started looking in to it. The test case is running the `script` utility with the --output-limit / -o option which stores the limit in the maxsz variable. It then compares the generated output to the expected output linked above. If the output differs, the test fails. In `script`, the amount of output generated is checked against maxsz each time callback_log_stream_activity() is called by the common pty I/O handling. If the maximum output has been reached, the program terminates early. The whole of the current buffer is logged to the output file *before* this check occurs, so more than maxsz characters can be written to the output before the program terminates. In the util-linux library functions, handle_io() simply reads up to BUFSIZ bytes from the pty using the read() syscall. These reads are buffered, so it's not guaranteed that the string "2:1234567890\n" printed by the echo command to the pty master arrives in a single read() call from the pty slave. Most of the time it will, but it's not guaranteed. This string is 13 characters long, and maxsz is 9 in the test, so if the last 1-3 characters aren't seen in the first read() call the program will terminate early (as maxsz has been reached) and the remaining characters will be lost. If this happens, the test output won't match the expected output and the test case will fail. There's a couple of ways to fix this, either maxsz can be enforced as a hard limit so that the number of characters printed is predictable, or the comparison with the expected output can be changed to allow for the expected differences. We should raise this with upstream. Links: - The failing test case: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/tests/ts/script/options?h=v2.41.2#n60 - Expected output: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/tests/expected/script/options-size?h=v2.41.2 - Handling of maxsz in the script utility, in callback_log_stream_activity(): https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/term-utils/script.c?h=v2.41.2#n691 - Main pty I/O handler which calls callback_log_stream_activity() via a callback: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/lib/pty-session.c?h=v2.41.2#n449
I built the current HEAD of util-linux, commit e4656fa9765f ("zramctl: Add note about column descriptions"), and ran the offending test case in a loop on my local machine, while running builds in the background: $ for i in $(seq 0 4095); do SCRIPT_TEST_SECOND_SINCE_EPOCH=1432489398 TZ=GMT ../util-linux/test_script -o 9 --command "echo 1:1234567890" test$i > /dev/null < /dev/null 2>&1 ; done I got 3849 runs with the expected output (94%): > Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo 1:1234567890" <not executed on terminal>] > 1:1234567890 > > Script done on 2015-05-24 17:43:18+00:00 [<max output size exceeded>] I got 247 runs with newlines missing (6%): > Script started on 2015-05-24 17:43:18+00:00 [COMMAND="echo 1:1234567890" <not executed on terminal>] > 1:1234567890 > Script done on 2015-05-24 17:43:18+00:00 [<max output size exceeded>] I didn't get any other variants of the output. So, the test case is definitely flaky. I'll start talking to upstream.
Email sent to util-linux mailing list: https://lore.kernel.org/util-linux/978c83bdf7596879458f39f1789da016150a72d4.camel@pbarker.dev/T/#u > I see two possible ways to fix this flaky test: > > 1) Modify `script` to never print more characters than the requested > output limit. This will ensure that the generated output is always > consistent, regardless of the influence of I/O buffering. > > 2) Modify the test case to accept both of the above possible output > variants. > > We would like some input from folks more familiar with util-linux on > which of those options is preferred.
No reply from upstream, I suggest we patch out this test for now.
This should be fixed by: util-linux: Disable flaky script/options-size test https://lore.kernel.org/openembedded-core/20260105-util-linux-ptest-v1-1-d9d99a147a2b@pbarker.dev/
https://git.openembedded.org/openembedded-core/commit/?id=b7a698d81b7435143525e7ef408c322b11937596