From f3ed0b372d990eade2e4727f17d9ee40003badb1 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 24 Feb 2016 02:45:49 -0500 Subject: test_must_fail: report number of unexpected signal If a command is marked as test_must_fail but dies with a signal, we consider that a problem and report the error to stderr. However, we don't say _which_ signal; knowing that can make debugging easier. Let's share as much as we know. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/test-lib-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index c64e5a5025..8d99eb303f 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -617,7 +617,7 @@ test_must_fail () { return 0 elif test $exit_code -gt 129 && test $exit_code -le 192 then - echo >&2 "test_must_fail: died by signal: $*" + echo >&2 "test_must_fail: died by signal $(($exit_code - 128)): $*" return 1 elif test $exit_code -eq 127 then -- cgit v1.2.1 From 43f3afc6bc6b79715ea46aaf341683cbba6ee965 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 24 Feb 2016 02:48:36 -0500 Subject: t5504: handle expected output from SIGPIPE death Commit 8bf4bec (add "ok=sigpipe" to test_must_fail and use it to fix flaky tests, 2015-11-27) taught t5504 to handle "git push" racily exiting with SIGPIPE rather than failing. However, one of the tests checks the output of the command, as well. In the SIGPIPE case, we will not have produced any output. If we want the test to be truly non-flaky, we have to accept either output. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5504-fetch-receive-strict.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh index 89224edcc5..a3e12d295a 100755 --- a/t/t5504-fetch-receive-strict.sh +++ b/t/t5504-fetch-receive-strict.sh @@ -101,7 +101,10 @@ test_expect_success 'push with receive.fsckobjects' ' git config transfer.fsckobjects false ) && test_must_fail ok=sigpipe git push --porcelain dst master:refs/heads/test >act && - test_cmp exp act + { + test_cmp exp act || + ! test -s act + } ' test_expect_success 'push with transfer.fsckobjects' ' -- cgit v1.2.1