test(linux): tolerate readiness timeout boundary

This commit is contained in:
Neil
2026-08-31 05:48:34 -07:00
parent eec969499e
commit f9d226bd02
2 changed files with 9 additions and 0 deletions
@@ -60,6 +60,11 @@ ready_line=$(timeout "$startup_timeout_seconds" bash -c '
| sed -u -n 's/^[^{]*//p' \
| jq --unbuffered -Rnc '\''first(inputs | fromjson? | select(.type == "orca_server_ready" and .schemaVersion == 1))'\''
' bash "$app_pid" "$stdout_log" || true)
# A readiness event can land as the timeout tears down the tail pipeline.
if [[ -z "$ready_line" ]]; then
ready_line=$(sed -u -n 's/^[^{]*//p' "$stdout_log" \
| jq --unbuffered -Rnc 'first(inputs | fromjson? | select(.type == "orca_server_ready" and .schemaVersion == 1))')
fi
if [[ -z "$ready_line" ]]; then
cat "$stdout_log" "$stderr_log" >&2
echo "FAIL: entrypoint exited or timed out before orca_server_ready" >&2
@@ -70,6 +70,10 @@ describe('headless serve shutdown PR gate', () => {
it('keeps the readiness parser line-buffered', () => {
expect(signalCase).toContain("| sed -u -n 's/^[^{]*//p'")
expect(signalCase).toContain(
'A readiness event can land as the timeout tears down the tail pipeline.'
)
expect(signalCase).toContain('ready_line=$(sed -u -n')
})
it('checks that a serving-electron signal target owns the ready socket', () => {