coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

cp: fix flaky test test_cp_arg_interactive_update, document adjacent bug

Open BenWiederhake opened this issue 1 year ago • 3 comments

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.

BenWiederhake avatar Feb 25 '24 19:02 BenWiederhake

Changes since last push:

  • I accidentally copied Therefore, the error code will be 0 verbatim in the new test, which is obviously wrong.

BenWiederhake avatar Feb 25 '24 19:02 BenWiederhake

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

BenWiederhake avatar Feb 25 '24 20:02 BenWiederhake

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)

github-actions[bot] avatar Feb 25 '24 20:02 github-actions[bot]

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Feb 28 '24 09:02 github-actions[bot]

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!

BenWiederhake avatar Mar 01 '24 10:03 BenWiederhake

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

BenWiederhake avatar Mar 01 '24 11:03 BenWiederhake

Thanks!

cakebaker avatar Mar 01 '24 13:03 cakebaker