coreutils
coreutils copied to clipboard
cp: fix flaky test test_cp_arg_interactive_update, document adjacent bug
Fixes #4725
This fixes a flaky test that causes real problems.
As the test already documents, -u -i won't show a prompt, so trying to pipe some stdin into it is pointless, and also causes a race.
Changes since last push:
- I accidentally copied
Therefore, the error code will be 0verbatim in the new test, which is obviously wrong.
The CI failures are both flakes:
- The failure on i686 is the known issue #6017
- The failure on macos aarch64 seem to be unrelated
The most-relevant output of the macos aarch64 failure
test_stdin_pipe_fifo1 looks like our classic stdin-race:
---- test_stat::test_stdin_pipe_fifo1 stdout ----
run: /Users/runner/work/coreutils/coreutils/target/aarch64-apple-darwin/debug/coreutils stat -
run: /Users/runner/work/coreutils/coreutils/target/aarch64-apple-darwin/debug/coreutils stat -L -
thread 'test_stat::test_stdin_pipe_fifo1' panicked at 'Expected stderr to be empty, but it's:
stat: cannot stat '-': Bad file descriptor (os error 9)
', tests/by-util/test_stat.rs:285:10
test_kill_subprocess looks like maybe it's a timing issue?
---- test_timeout::test_kill_subprocess stdout ----
run: /Users/runner/work/coreutils/coreutils/target/aarch64-apple-darwin/debug/coreutils timeout 10 sh -c sh -c "trap 'echo xyz' TERM; sleep 30"
thread 'test_timeout::test_kill_subprocess' panicked at ''' does not contain 'xyz'', tests/by-util/test_timeout.rs:158:10
GNU testsuite comparison:
GNU test failed: tests/tail/descriptor-vs-rename. tests/tail/descriptor-vs-rename is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
GNU testsuite comparison:
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Changes since last push:
- Rebased on current master
- Added a comment why
pipe_in("")occurs (namely: To make extra-super-duper-sure that piping-in nothing and closing stdin behaves the same.) Thanks @cakebaker!
test_stat::test_stdin_pipe_fifo2 flaked.
---- test_stat::test_stdin_pipe_fifo2 stdout ----
run: /Users/runner/work/coreutils/coreutils/target/x86_64-apple-darwin/debug/coreutils stat -
thread 'test_stat::test_stdin_pipe_fifo2' panicked at '' File: -
Size: 0 Blocks: 0 IO Block: 131072 weird file
Device: fffffffffe0f8a18h/18446744073677015576d Inode: 314 Links: 1
Access: (0666/?rw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ wheel)
Access: 2024-03-01 10:52:27.507734000 +0000
Modify: 2024-03-01 10:52:26.661072000 +0000
Change: 2024-03-01 10:52:26.661072000 +0000
Birth: 1970-01-01 00:00:00.000000000 +0000
' does not contain 'character special file'', tests/by-util/test_stat.rs:302:10
Thanks!