From 13908366c3b8a84195c0b769689baf1008be3f56 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 09:11:57 -1000 Subject: Prove a failed final write abandoned the fill Nothing showed that the limited write failed at all, so a limit that did not bite passed, as did a lock file left behind, a doubled prefix or a page resumed from the wrong offset. The pipe to cat also threw away cgit's exit status. --- tests/t0003-cache.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index 4df6b83..a0cff72 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -263,11 +263,18 @@ test_expect_success 'a failed final write still delivers the page' ' ( trap "" XFSZ && ulimit -f 2 && - cgit_rc bigkeyrc "url=bigpage/" 2>flush.err + { cgit_rc bigkeyrc "url=bigpage/" 2>flush.err; echo $? >flush.status; } ) | cat >flush.out && - grep "^Status: 200" flush.out && - grep "" flush.out && - ! grep "called many times" flush.err + test "$(cat flush.status)" = 0 && + test_dir_is_empty cache3 && + test $(grep -c "^Status:" flush.out) = 1 && + test_grep "^Status: 200" flush.out && + test_grep ! "called many times" flush.err && + sed "s/^cache-size=.*/cache-size=0/" bigkeyrc >flushnocacherc && + cgit_ok flushnocacherc "url=bigpage/" >flush.nocache && + strip_headers expect && + strip_headers actual && + test_cmp expect actual ' # The first request's filter says through a marker that it is running, and -- cgit 2.12.1