git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] robustifying t5504
@ 2016-02-24  7:36 Jeff King
  2016-02-24  7:40 ` [PATCH 1/4] write_or_die: handle EPIPE in async threads Jeff King
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jeff King @ 2016-02-24  7:36 UTC (permalink / raw)
  To: git; +Cc: Lars Schneider

I got a spurious test failure on t5504 while running the test suite
today. This is the result of my quest through the SIGPIPE rabbit hole.

Since this is not the first time I've investigated tests failing under
load, I finally broke down and wrote a helper script. It probably needs
some adapting for other people's environments, but I'll share it here in
case anyone is interested:

-- >8 --
#!/bin/sh

test=$1; shift
test=$(cd t && echo $test*.sh)
: ${GIT_STRESS_LOAD:=$(( 2 * $(grep -c ^processor /proc/cpuinfo)))}
: ${GIT_STRESS_ROOT:=/var/ram/git-stress}

mkdir -p "$GIT_STRESS_ROOT" || exit 1
rm -f "$GIT_STRESS_ROOT/fail"
trap 'echo aborted >"$GIT_STRESS_ROOT/fail"' TERM INT HUP
for i in $(seq $GIT_STRESS_LOAD); do
	(
		cd t &&
		while ! test -e "$GIT_STRESS_ROOT/fail"
		do
			if ./$test \
			   --root="$GIT_STRESS_ROOT/trash-$i" \
			   -v -i >"$GIT_STRESS_ROOT/output-$i" 2>&1
			then
				echo >&2 "OK $i"
			else
				echo >&2 "FAIL $i"
				cp "$GIT_STRESS_ROOT/output-$i" "$GIT_STRESS_ROOT/fail"
			fi
		done
	) &
done
wait
cat "$GIT_STRESS_ROOT/fail"
-- 8< --

You can run it like "./stress t5504", and it will run t5504 over and
over in parallel until one instance fails. Without this patch series,
t5504 generally fails for me within 30 seconds or so. With it, I can run
for several minutes without problems.

  [1/4]: write_or_die: handle EPIPE in async threads
  [2/4]: fetch-pack: ignore SIGPIPE in sideband demuxer
  [3/4]: test_must_fail: report number of unexpected signal
  [4/4]: t5504: handle expected output from SIGPIPE death

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-24  7:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24  7:36 [PATCH 0/4] robustifying t5504 Jeff King
2016-02-24  7:40 ` [PATCH 1/4] write_or_die: handle EPIPE in async threads Jeff King
2016-02-24  7:44 ` [PATCH 2/4] fetch-pack: ignore SIGPIPE in sideband demuxer Jeff King
2016-02-24  7:45 ` [PATCH 3/4] test_must_fail: report number of unexpected signal Jeff King
2016-02-24  7:48 ` [PATCH 4/4] t5504: handle expected output from SIGPIPE death Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).