Skip to content

CI: report a budget timeout as Timeout, not Server died - #106228

Closed
Algunenano wants to merge 1 commit into
ClickHouse:masterfrom
Algunenano:ci-flaky-timeout-not-server-died
Closed

Algunenano wants to merge 1 commit into
ClickHouse:masterfrom
Algunenano:ci-flaky-timeout-not-server-died

Conversation

@Algunenano

Copy link
Copy Markdown
Member

A job-level wall-clock budget timeout in the flaky and targeted stateless checks is currently reported as Server died, even though the server is healthy and shuts down cleanly. When a run exceeds its budget, Shell._check_timeout kills the runner with SIGTERM, and the result parser treats any SIGTERM exit code (-15 / 143) as an aborted run and attaches a synthetic Server died leaf. A timeout is not a crash, so this is misleading and triggers spurious server-death alerts.

The behavior was introduced by 8536a678354 and 07778ae4699, which intentionally folded job-level timeouts into ABORTED_RUN_EXIT_CODES. cc @leshikus

The fix threads a real signal from the only place that knows the kill was a timeout: Shell._check_timeout records into an optional timeout_status list right before sending SIGTERM, and only when the process was still alive, so a runner that finished on its own within the budget is not misreported. run_tests returns whether the budget timeout fired, and FTResultsProcessor.run reports a Timeout leaf instead of Server died. The completed per-test results stay authoritative (no demotion to UNKNOWN), so a genuine failure that happened before the timeout stays visible. A genuine mid-flight abort (worker to parent SIGTERM feedback loop, runner shutdown, real server death) still has timed_out=False and keeps the existing Server died behavior.

Observed on:

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Report a stateless-check budget timeout as Timeout instead of Server died.

The functional-test result parser labels any runner SIGTERM (exit -15 / 143)
as `Server died`. That sweeps in the job-level wall-clock budget timeout used
by the flaky and targeted checks: when the run exceeds its budget,
`Shell._check_timeout` kills the runner with SIGTERM and the parser attaches a
synthetic `Server died` leaf even though the server is healthy and exited
cleanly. The check should report a timeout, not a server death.

This was introduced by `8536a678354` (treat SIGTERM/SIGKILL as aborted run)
and `07778ae4699` (also treat negative signal codes), which folded job-level
timeouts into `ABORTED_RUN_EXIT_CODES`.

Thread a real signal from the one place that knows the kill was a timeout.
`Shell._check_timeout` records into an optional `timeout_status` list right
before sending SIGTERM, and only when the process was still alive, so a runner
that finished on its own within the budget is not misreported. `run_tests`
returns whether the budget timeout fired and `FTResultsProcessor.run` reports a
`Timeout` leaf instead of `Server died` in that case. The completed per-test
results stay authoritative (no demotion to `UNKNOWN`), so a genuine failure
that happened before the timeout remains visible.

A genuine mid-flight abort (worker to parent SIGTERM feedback loop, runner
shutdown, real server death) still has `timed_out=False` and keeps the existing
`Server died` behavior.

Observed on:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=105019&sha=latest&name_0=PR&name_1=Stateless+tests+%28arm_asan_ubsan%2C+targeted%29
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104965&sha=b8200879b832ff77f5a82d8d8e5c77efe10d0353&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20flaky%20check%29

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3c394a6]

Summary: ✅


AI Review

Summary

This PR changes functional stateless CI timeout classification by propagating a timeout marker from Shell._check_timeout through run_tests into FTResultsProcessor.run, so a budget kill is reported as Timeout instead of Server died while preserving completed per-test failures. I found no code issues that require inline comments.

Missing context / blind spots
  • ⚠️ The PR CI Tests job was still pending during review, and local pytest collection could not run because this environment has no pytest module. A direct processor check for the new timed_out=True branch passed.
Final Verdict

Status: ✅ Approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant