Files
Groene AIandClaude Opus 4.8 2db0133e48 Fix flaky test_executable_udf_async_metrics by resetting the metric baseline
The async-metric observability tests measure a delta against mem_before /
procs_before snapshots. Six of the eight subtests call restart_clickhouse()
first, so they start from a clean 0/0 baseline. Three did not:
test_inflight_executable_invocation_is_visible,
test_timed_out_executable_is_killed_and_leaves_metrics, and
test_non_udf_shell_commands_are_not_counted.

The three preceding pool tests run executable_pool UDFs and never restart
afterwards, so they leave idle pool workers (each holding ~128 MiB) registered
in the metrics. The no-restart subtests therefore captured mem_before while
that residual was live (observed ~275 MiB across three idle workers). Because
asynchronous_metrics refresh once per second and idle pool workers are reaped
on max_command_execution_time, the residual also shifted during the subtest's
own 25 s measurement window: when it stayed, the delta overshot the one-worker
band (CI saw +170..187 MiB); when a worker was reaped mid-window, the delta
went negative (CI saw -137 MiB). Both are exactly the arm_binary failures in
the report.

Fix: have the three no-restart subtests restart and wait for the metric to
settle, matching the clean 0/0 baseline the other six already establish. This
removes the residual contamination without weakening any assertion.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-23 11:15:26 +00:00
..