Skip to content

Report fuzzer runner aborts instead of an opaque status.tsv FileNotFoundError - #107676

Merged
alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/fix-fuzzer-runner-missing-status-tsv
Jun 22, 2026
Merged

alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/fix-fuzzer-runner-missing-status-tsv

Conversation

@groeneai

Copy link
Copy Markdown
Collaborator

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):

...

Description

When the AST/BuzzHouse fuzzer process is killed before it writes status.tsv (job timeout, OOM, or a docker/orchestration failure), run_fuzz_job reported an opaque Unknown error in fuzzer runner script followed by a FileNotFoundError traceback. That gives no hint of the real abort cause and reads like a code crash, even though it is a CI-infrastructure flake that a re-run clears. Over the last 7 days this surfaced as spurious red BuzzHouse (*) / AST fuzzer (*) checks across ~18 unrelated PRs (and master), typically with only one of the four BuzzHouse builds failing on a given SHA while the other three pass on the identical commit.

This change distinguishes the two cases:

  • Missing or empty status.tsv (the runner aborted before reporting): emit an actionable message that says the runner aborted before producing status, explains it is a CI-infrastructure issue rather than a fuzzer finding (a real finding writes status.tsv with a FAIL status and a stack trace), and inlines the tail of the fuzzer.log / server.log / stderr.log artifacts so the underlying abort cause is visible.
  • Malformed status.tsv (a genuine harness bug): keep the traceback for debugging.

The status stays ERROR so the check is still red and a maintainer re-runs it; no auto-retry signal is invented (praktika has no retry path for python-callable jobs).

The parsing and message formatting are extracted into dependency-free helpers (_read_fuzzer_status, _format_status_error, _log_tail) and covered by unit tests in ci/tests/test_e2e.py (valid / missing / empty / malformed status, and the infra-vs-harness message shape).

No related open issue found (searched the status.tsv / ast_fuzzer_job signature on 2026-06-16).

…undError

When the AST/BuzzHouse fuzzer process is killed before it writes status.tsv
(job timeout, OOM, or a docker/orchestration failure), run_fuzz_job used to
fail with an opaque "Unknown error in fuzzer runner script" FileNotFoundError
traceback. That gives no hint of the real abort cause and reads like a code
crash, even though it is a CI-infrastructure flake that a re-run clears.

Distinguish a missing/empty status.tsv (runner aborted early -> infra) from a
malformed status.tsv (a real harness bug) and, for the former, emit an
actionable message that says the runner aborted before reporting and inlines
the tail of the fuzzer/server/stderr logs so the abort cause is visible. The
malformed case keeps the traceback. Status stays ERROR so the check is still
red and a maintainer re-runs it.

The parsing and message formatting are extracted into dependency-free helpers
(_read_fuzzer_status, _format_status_error, _log_tail) and covered by unit
tests in ci/tests/test_e2e.py.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate

# Question Answer
a Deterministic repro? Yes for the harness behavior under test. The original CI signature (a server-side fuzzer abort that leaves no status.tsv) is a timing/orchestration flake that is not reproducible on demand, but the runner's reaction to a missing/empty/malformed status.tsv is fully deterministic and is exercised directly via the new unit tests by pre-seeding (or omitting) the file.
b Root cause explained? The fuzzer process is killed (job timeout / OOM / docker-orchestration failure) before run-fuzzer.sh reaches the echo ... > status.tsv line. run_fuzz_job then opened that absent file, raising FileNotFoundError, which the catch-all turned into an opaque Unknown error in fuzzer runner script traceback. So a CI-infra abort was reported as if it were a code crash, with no hint of the real cause.
c Fix matches root cause? Yes. The fix targets exactly the status-read path: it detects a missing/empty status.tsv (the early-abort signature) and reports it as a CI-infrastructure abort with the underlying log tails surfaced, distinct from a malformed status.tsv (kept as a harness bug with traceback). It does not mask the failure (status stays ERROR) and does not touch fuzzer logic.
d Test intent preserved / new tests added? New tests added (ci/tests/test_e2e.py): valid status parse, missing, empty, malformed, and the infra-vs-harness message shape (infra message carries no traceback and inlines the log tail; harness message keeps the traceback). The pre-existing test_fuzzer/test_stress e2e tests are unchanged.
e Both directions demonstrated? Yes. Before: missing status.tsv -> headline Unknown error in fuzzer runner script. Traceback: ... FileNotFoundError, no infra wording, logs not surfaced. After: headline Fuzzer runner aborted before producing status.tsv ... This is a CI infrastructure issue, not a fuzzer finding, no opaque traceback, fuzzer.log tail inlined. The 5 new unit tests pass (5/5).
f Fix is general, not a narrow patch? This is a CI-harness diagnostics fix, not a server bug, so the sibling-path question is about the runner. All four status.tsv outcomes (valid / missing / empty / malformed) are handled in one place (_read_fuzzer_status + _format_status_error), used by both AST-fuzzer and BuzzHouse variants since they share run_fuzz_job. No defensive symptom-guard: the abort is still reported (ERROR), just with an actionable message; no auto-retry signal is invented because praktika has no retry path for python-callable jobs.

Session id: cron:clickhouse-worker-slot-1:20260616-205900

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @george-larionov — could you review this? It makes run_fuzz_job report a missing/empty status.tsv as a CI-infra abort (with the fuzzer/server log tails inlined) instead of the opaque FileNotFoundError traceback, while keeping the traceback for a genuinely malformed status.tsv. Refines the early-abort try/except you added in 937f5ff.

@nikitamikhaylov nikitamikhaylov added the can be tested Allows running workflows for external contributors label Jun 17, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b13a06a]

Summary: ✅


AI Review

Summary

This PR makes run_fuzz_job report missing or empty status.tsv as an early fuzzer-runner abort with log tails, while keeping malformed status.tsv as a harness exception. The previous inline concerns about over-classifying the abort as infrastructure and misdescribing the status.tsv contract are addressed in the current code; both bot-authored threads are now resolved. I found no new correctness, safety, or metadata issues that need inline comments.

Missing context / blind spots
  • ⚠️ The focused local pytest run did not execute because pytest is not installed in this checkout environment. The direct Praktika report for b13a06ada3d7a1b55283c094e2e918816b263745 was still in progress (CI Tests and fuzzer jobs pending), so I could not independently validate passing test execution from CI during this review.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 17, 2026
Comment thread ci/jobs/ast_fuzzer_job.py Resolved
A missing status.tsv does not uniquely mean CI infrastructure. run-fuzzer.sh
runs under 'set -e' and writes status.tsv only at the very end, so any earlier
failure (a server startup failure where the pid file is never created, a
fuzzer-harness error, or an infra timeout/OOM/docker problem) also reaches the
read site. Asserting infra and 'a re-run usually clears it' would hide a real
server-startup or harness regression.

Reword the missing-status branch to list the possible causes neutrally and
direct the reader to the inlined log tails to determine the actual cause,
without claiming infra or suggesting a re-run. The malformed-status branch is
unchanged. Rename the unit test to assert the neutral shape (no infra claim,
no 're-run').

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Comment thread ci/jobs/ast_fuzzer_job.py Resolved
run-fuzzer.sh writes only the three numeric fields (server_died,
server_exit_code, fuzzer_exit_code) to status.tsv. The FAIL verdict and
stack trace are produced later by run_fuzz_job / FuzzerLogParser after a
complete status file is parsed. The diagnostic said a finding "writes
status.tsv with a FAIL status and a stack trace", which mis-described the
contract; reword it to say a finding writes a complete status.tsv that is
then reported as FAIL from the logs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants