Repository navigation
Conversation
The flaky check's `Shell.run(timeout=...)` is the only wall-clock guard: `clickhouse-test` itself never knows about the budget, so it keeps running until the wrapper SIGTERMs it. That kill can land mid-query — e.g. the post-test `system.trace_log` aggregate on a debug build with a huge accumulated `trace_log` — failing a run where every test actually passed. Seen on PR #104860 (touches ~32 stateless tests; flaky check ran them all 50x); job timed out at 2180s with `clickhouse-test exited with code -15`, even though `All tests have finished.` printed 69 s earlier and every iteration passed. Two changes: 1. `tests/clickhouse-test`: cap the post-`All tests have finished.` diagnostics with `SETTINGS max_execution_time` and matching HTTP timeouts — the `MemoryAllocatedWithoutCheck` aggregate, the `SYSTEM FLUSH LOGS system.trace_log`, and the per-test-coverage queries. If the server is overloaded they are skipped with a logged exception instead of blocking shutdown. 2. `ci/jobs/functional_tests.py`: forward `--global_time_limit` to `clickhouse-test` (budget minus 180 s of shutdown headroom). `clickhouse-test` stops scheduling new test iterations gracefully and has time to run the hung-check + (now-bounded) diagnostics before the outer `Shell.run` SIGTERM fires. The outer timeout stays as a last-resort kill. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104860&sha=0bd90393d11807d0090b718e119cb03889f31fd7&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29 PR: #104860 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Workflow [PR], commit [498a282] Summary: ❌
AI ReviewSummaryThis PR bounds several post-test operations in Findings
Final VerdictStatus: Minimum required actions:
|
| # every test actually passed. | ||
| SHUTDOWN_HEADROOM = 180 # seconds reserved for hung-check + diagnostics + flush | ||
| inner_args = extra_args | ||
| if global_time_limit and global_time_limit > SHUTDOWN_HEADROOM and "--global_time_limit" not in extra_args: |
There was a problem hiding this comment.
global_time_limit <= SHUTDOWN_HEADROOM currently skips adding inner --global_time_limit, so clickhouse-test keeps scheduling new tests right up to the outer Shell.run timeout and can still be SIGTERM'ed mid-query.
That leaves the exact false-failure mode this change is trying to remove whenever the remaining budget is small (e.g. delayed startup leaves <180s for the test stage).
Can we always pass an inner limit when global_time_limit > 0, e.g. max(1, global_time_limit - SHUTDOWN_HEADROOM)? This makes clickhouse-test stop scheduling immediately when little time is left, instead of running until outer SIGTERM.
| "SELECT count() FROM system.coverage_indirect_calls FINAL", | ||
| timeout=40, settings=post_settings, | ||
| ) | ||
| or 0 |
There was a problem hiding this comment.
These two coverage stats queries are now hard-bounded (max_execution_time=30, client timeout 40) but unlike the coverage_indirect_calls block below they are not in a try/except.
If either query times out on a large system.coverage_log, the script throws here and the whole job fails after all tests already passed.
Can we either wrap cov_rows/cov_tests in the same best-effort error handling used below, or avoid turning these post-run informational stats into a hard failure path?
There was a problem hiding this comment.
I think this is somewhat valid concern. If our goal is the reduce the flakyness, let's wrap these in try blocks. I think getting a timeout is not a problem as they are only printed (I assume) as some debug information.
|
Dear @antaljanosbenjamin, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
|
closing for now, reopen if it will become an issue in ci again |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...