git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/4] robustifying t5504

From
Jeff King <peff@peff.net>
Date
Feb 24, 2016, 07:36 UTC
Message-ID
<20160224073603.GA9163@sigill.intra.peff.net>

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
Next: Jeff King
Message 1 of 5 in “robustifying t5504”
  1. 0/4 robustifying t5504Jeff King, Feb 24, 2016
  2. 1/4 write_or_die: handle EPIPE in async threadsJeff King, Feb 24, 2016
  3. 2/4 fetch-pack: ignore SIGPIPE in sideband demuxerJeff King, Feb 24, 2016
  4. 3/4 test_must_fail: report number of unexpected signalJeff King, Feb 24, 2016
  5. 4/4 t5504: handle expected output from SIGPIPE deathJeff King, Feb 24, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.