mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 02:57:37 +01:00
ci: the stderr fallback and a missing recorder have their own controls
The dead-recorder twins wrote a large stdout but one short stderr line, so removing only the stderr fallback still passed. A fake Go that writes 10,000 stderr lines now runs with a recorder that dies after 100 bytes, and with no recorder at all (no such interpreter); each keeps Go's own exit 0 and 7, and dropping the stderr fallback turns the suite red. The sampler stop test's wait for its stand-in is bounded (10 s) and fails at once if the stand-in exits before it is ready. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
69cd5c08bb
commit
7cb62f3b71
2 files changed
+17
No files matched your search
@@ -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()
|
||||
|
||||
@@ -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'
|
||||
Reference in new issue
Block a user