diff --git a/seaweed-block/.github/scripts/ci-load-test.py b/seaweed-block/.github/scripts/ci-load-test.py index b09cd6903f..90ff55d3af 100644 --- a/seaweed-block/.github/scripts/ci-load-test.py +++ b/seaweed-block/.github/scripts/ci-load-test.py @@ -52,7 +52,10 @@ class LoadTest(unittest.TestCase): 'import pathlib,signal,sys,time; signal.signal(signal.SIGTERM, signal.SIG_IGN); ' 'pathlib.Path(sys.argv[1]).touch(); time.sleep(30)', str(ready)]) try: + deadline = time.monotonic()+10 while not ready.exists(): + self.assertIsNone(stubborn.poll(), 'the stand-in exited before it was ready') + self.assertLess(time.monotonic(), deadline, 'the stand-in never became ready') time.sleep(0.01) output.with_suffix('.pid.json').write_text(json.dumps(dict(pid=stubborn.pid, start=load.identity(stubborn.pid)))) began = time.monotonic() diff --git a/seaweed-block/.github/scripts/record-go-test-test.sh b/seaweed-block/.github/scripts/record-go-test-test.sh index b98de88e99..54bd092d34 100644 --- a/seaweed-block/.github/scripts/record-go-test-test.sh +++ b/seaweed-block/.github/scripts/record-go-test-test.sh @@ -15,6 +15,9 @@ if [ "${FAKE_GO_LARGE:-0}" = 1 ]; then for ((i=0; i<10000; i++)); do printf '%s\n' '{"Action":"output","Output":"draining after recorder failure\n"}'; done fi echo 'fixture stderr' >&2 +if [ "${FAKE_GO_LARGE_STDERR:-0}" = 1 ]; then + for ((i=0; i<10000; i++)); do echo 'stderr draining after recorder failure' >&2; done +fi exit "${FAKE_GO_EXIT:-0}" EOF chmod +x "$root/bin/go" @@ -57,5 +60,16 @@ for want in 0 7; do test "$code" = "$want" grep -q 'draining after recorder failure' "$root/console" grep -q 'the recorder exited' "$root/stderr" + # The stderr reader dies with a large stderr still to come. + code=0 + PYTHON="$root/bin/dead-recorder" FAKE_GO_LARGE_STDERR=1 FAKE_GO_EXIT=$want bash "$here/record-go-test.sh" "$root/dead.json" >"$root/console" 2>"$root/stderr" || code=$? + test "$code" = "$want" + grep -q 'stderr draining after recorder failure' "$root/stderr" + # The recorder cannot start at all (no such interpreter). + code=0 + PYTHON="$root/bin/no-such-python" FAKE_GO_LARGE=1 FAKE_GO_LARGE_STDERR=1 FAKE_GO_EXIT=$want bash "$here/record-go-test.sh" "$root/dead.json" >"$root/console" 2>"$root/stderr" || code=$? + test "$code" = "$want" + grep -q 'draining after recorder failure' "$root/console" + grep -q 'stderr draining after recorder failure' "$root/stderr" done echo 'record-go-test: output, timestamp, elapsed, append, dead-recorder and exit-status controls PASS'