Skip to content

Pass invalid argument in valgrindTest to force failure#4648

Merged
Cyan4973 merged 1 commit intofacebook:devfrom
eyupcanakman:fix/valgrind-test-no-arg
Apr 25, 2026
Merged

Pass invalid argument in valgrindTest to force failure#4648
Cyan4973 merged 1 commit intofacebook:devfrom
eyupcanakman:fix/valgrind-test-no-arg

Conversation

@eyupcanakman
Copy link
Copy Markdown
Contributor

zstd with no arguments prints help and exits 0. The valgrind test harness at build/meson/tests/valgrindTest.py and its mirror in tests/Makefile assume the opposite and raise zstd without argument should have failed. Pass --parameter-does-not-exist instead so zstd exits 1 via its unknown-flag path.

Fixes #4366.

@meta-cla meta-cla Bot added the CLA Signed label Apr 19, 2026
@Cyan4973
Copy link
Copy Markdown
Contributor

Cyan4973 commented Apr 19, 2026

zstd without any argument should fail (i.e. return 1), unless it's piped via stdin and stdout.
If it doesn't, it's a bug, that should be fixed.

I just tested ./zstd (no argument) on a build of the latest dev branch,
and it did fail as expected on the test system.

@eyupcanakman
Copy link
Copy Markdown
Contributor Author

On non-TTY stdin (the valgrind subprocess case), zstd accepts input per your "piped" exception. Local check: ./programs/zstd < /dev/null > /dev/null; echo $? prints 0. --fake-stdin-is-console (@terrelln, e58a39f) lets the test simulate a console stdin so the abort fires directly. Want me to swap it in?

@Cyan4973
Copy link
Copy Markdown
Contributor

yes, sounds proper

@eyupcanakman eyupcanakman force-pushed the fix/valgrind-test-no-arg branch from eacea7e to 44ebbde Compare April 20, 2026 17:12
@eyupcanakman
Copy link
Copy Markdown
Contributor Author

Swapped. Original assertion message restored.

@Cyan4973 Cyan4973 merged commit 0cdce55 into facebook:dev Apr 25, 2026
105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.5.7: test suite fails in zstd / valgrindTest

2 participants