git/t/helper
Jiang Xin f65003b4c4 receive-pack: gently write messages to proc-receive
Johannes found a flaky hang in `t5411/test-0013-bad-protocol.sh` in the
osx-clang job of the CI/PR builds, and ran into an issue when using
the `--stress` option with the following error messages:

    fatal: unable to write flush packet: Broken pipe
    send-pack: unexpected disconnect while reading sideband packet
    fatal: the remote end hung up unexpectedly

In this test case, the "proc-receive" hook sends an error message and
dies earlier. While "receive-pack" on the other side of the pipe
should forward the error message of the "proc-receive" hook to the
client side, but it fails to do so. This is because "receive-pack"
uses `packet_write_fmt()` and `packet_flush()` to write pkt-line
message to "proc-receive" hook, and these functions die immediately
when pipe is broken. Using "gently" forms for these functions will get
more predicable output.

Add more "--die-*" options to test helper to test different stages of
the protocol between "receive-pack" and "proc-receive" hook.

Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-11 12:46:56 -08:00
..
.gitignore drop vcs-svn experiment 2020-08-13 11:02:15 -07:00
test-advise.c test-advise: check argument count with argc instead of argv 2020-09-30 12:53:48 -07:00
test-bloom.c Merge branch 'tb/bloom-improvements' 2020-09-29 14:01:20 -07:00
test-chmtime.c
test-config.c config: fix leaks from git_config_get_string_const() 2020-08-14 10:52:04 -07:00
test-ctype.c
test-date.c test_date.c: remove reference to GIT_TEST_DATE_NOW 2019-09-18 14:15:01 -07:00
test-delta.c
test-dir-iterator.c Merge branch 'mt/dir-iterator-updates' 2019-08-09 10:13:14 -07:00
test-drop-caches.c Sync with 2.17.3 2019-12-06 16:29:15 +01:00
test-dump-cache-tree.c
test-dump-fsmonitor.c fsmonitor: change last update timestamp on the index_state to opaque token 2020-01-13 14:58:43 -08:00
test-dump-split-index.c t/helper/test-dump-split-index: initialize git repository 2020-02-24 09:33:24 -08:00
test-dump-untracked-cache.c
test-example-decorate.c object: convert lookup_unknown_object() to use object_id 2019-06-20 10:06:19 -07:00
test-fake-ssh.c
test-genrandom.c
test-genzeros.c
test-hash-speed.c
test-hash.c
test-hashmap.c hashmap_entry: remove first member requirement from docs 2019-10-07 10:20:12 +09:00
test-index-version.c
test-json-writer.c
test-lazy-init-name-hash.c OFFSETOF_VAR macro to simplify hashmap iterators 2019-10-07 10:20:11 +09:00
test-match-trees.c match-trees.c: remove the_repo from shift_tree*() 2019-06-27 12:45:17 -07:00
test-mergesort.c
test-mktemp.c
test-oid-array.c t/helper: initialize the repository for test-sha1-array 2020-06-19 14:04:08 -07:00
test-oidmap.c test-oidmap: remove 'add' subcommand 2019-07-01 10:26:28 -07:00
test-online-cpus.c
test-parse-options.c parse-options: add testcases for OPT_CMDMODE() 2020-02-20 13:20:40 -08:00
test-parse-pathspec-file.c test-parse-pathspec-file.c: s/0/NULL/ for pointer type 2020-04-27 11:21:12 -07:00
test-path-utils.c real_path: remove unsafe API 2020-03-10 11:41:40 -07:00
test-pkt-line.c pkt-line: define PACKET_READ_RESPONSE_END 2020-05-24 16:26:00 -07:00
test-prio-queue.c test-prio-queue: use xmalloc 2019-04-12 13:34:17 +09:00
test-proc-receive.c receive-pack: gently write messages to proc-receive 2020-11-11 12:46:56 -08:00
test-progress.c progress.c: silence cgcc suggestion about internal linkage 2020-04-27 11:21:28 -07:00
test-reach.c commit-reach: fix in_merge_bases_many bug 2020-10-02 10:26:31 -07:00
test-read-cache.c test-read-cache: drop namelen variable 2019-09-06 11:03:39 -07:00
test-read-graph.c t/helper/test-read-graph.c: prepare repo settings 2020-09-09 12:51:48 -07:00
test-read-midx.c multi-pack-index: use hash version byte 2020-08-17 16:45:20 -07:00
test-ref-store.c worktree: drop get_worktrees() unused 'flags' argument 2020-06-22 10:31:15 -07:00
test-regex.c t/helper: teach test-regex to report pattern errors (like REG_ILLSEQ) 2020-05-18 13:03:35 -07:00
test-repository.c t/helper: make repository tests hash independent 2020-02-24 09:33:27 -08:00
test-revision-walking.c
test-run-command.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
test-scrap-cache-tree.c
test-serve-v2.c Turn git serve into a test helper 2019-04-19 14:03:24 +09:00
test-sha1.c
test-sha1.sh
test-sha256.c
test-sigchain.c
test-strcmp-offset.c
test-string-list.c
test-submodule-config.c
test-submodule-nested-repo-config.c drop unused argc parameters 2020-09-30 12:53:47 -07:00
test-subprocess.c
test-tool.c receive-pack: add new proc-receive hook 2020-08-27 12:47:47 -07:00
test-tool.h receive-pack: add new proc-receive hook 2020-08-27 12:47:47 -07:00
test-trace2.c strvec: rename files from argv-array to strvec 2020-07-28 15:02:17 -07:00
test-urlmatch-normalization.c
test-wildmatch.c
test-windows-named-pipe.c use strpbrk(3) to search for characters from a given set 2020-02-24 09:30:31 -08:00
test-write-cache.c
test-xml-encode.c