Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cp: fix flaky test test_cp_arg_interactive_update, document adjacent bug #6020

Merged

Conversation

BenWiederhake
Copy link
Collaborator

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
Copy link
Collaborator Author

Changes since last push:

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

@BenWiederhake
Copy link
Collaborator Author

The CI failures are both flakes:

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

Copy link

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)

@sylvestre sylvestre force-pushed the dev-cp-flaky-arg_interactive_update branch from 0ed13f3 to 97da29b Compare February 28, 2024 08:42
Copy link

GNU testsuite comparison:

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

@BenWiederhake BenWiederhake force-pushed the dev-cp-flaky-arg_interactive_update branch from 97da29b to ba1c6b0 Compare March 1, 2024 10:41
@BenWiederhake
Copy link
Collaborator Author

BenWiederhake commented Mar 1, 2024

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
Copy link
Collaborator Author

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

@cakebaker cakebaker merged commit 09048a3 into uutils:main Mar 1, 2024
59 of 62 checks passed
@cakebaker
Copy link
Contributor

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_cp_arg_interactive_update fails on freebsd
2 participants