Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
| -rwxr-xr-x | tests/t0003-cache.sh | 15 |
1 file changed, 11 insertions, 4 deletions
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 "</html>" 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 <flush.nocache >expect && + strip_headers <flush.out >actual && + test_cmp expect actual ' # The first request's filter says through a marker that it is running, and |
