Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Make the early-exit filter meet a closed pipe
The email filter was handed a few bytes, which usually sit in the pipe
before the filter has even exited, so a cgit that died of SIGPIPE
passed most runs. A source filter handed more than a pipe holds has to
see the write fail.
| -rwxr-xr-x | tests/t0303-robustness.sh | 17 |
1 file changed, 10 insertions, 7 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index b189334..9ae0347 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -258,14 +258,17 @@ test_expect_success 'a filter that cannot run answers one error page' ' # The filter may exit before or after cgit writes to it, so the page either # completes or ends where the write failed. Either way cgit answers once and -# exits cleanly rather than dying of SIGPIPE. +# exits cleanly rather than dying of SIGPIPE. The file outgrows the pipe, so +# the write has to block and then fail however the two sides are scheduled. test_expect_success 'a filter that exits without reading does not end cgit' ' - { - echo "email-filter=exec:true" && - cat robrc - } >truerc && - cgit_rc truerc "url=rob/log/" >tmp && - test $(grep -c "^Status:" tmp) = 1 + mkrepo repos/quit 1 && + test_seq 20000 >repos/quit/big.txt && + git -C repos/quit add big.txt && + git -C repos/quit commit -q -m big && + cgitrc_repo quitrc quit source-filter=exec:true && + cgit_rc quitrc "url=quit/tree/big.txt" >tmp 2>err && + test $(grep -c "^Status:" tmp) = 1 && + test_grep "<div class=.blob-header.>blob: " tmp ' test_expect_success 'a commit encoding header is read without its newline' ' |
