Repository navigation
Fix flaky test_keeper_dynamic_log_level: poll for the log level change - #113938
Conversation
The test wrote a new logger config, slept a fixed 3 seconds and expected the asynchronous config reloader to have already applied the `trace` level, so on slow runs (e.g. MSan) the final assertion saw zero `<Trace>` lines: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=91062&sha=5bd33a1f41d843f69d93cb75e2192bb668e61368&name_0=PR&name_1=Integration%20tests%20%28amd_msan%2C%204%2F8%29 Related: #91062 Poll for up to a minute until trace logging becomes active instead.
|
Workflow [PR], commit [a3d2e56] Summary: ✅ AI ReviewSummaryThis PR replaces the fixed Final Verdict✅ No review findings. |
…amic-log-level-flaky
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units358 translation units recompiled, 362 s compile time in total, 6 of them have a recent master baseline. Translation units without a recent master baseline:
|
alexey-milovidov
left a comment
There was a problem hiding this comment.
Thanks! The test was laughably bad.
…er-dynamic-log-level Conflict in `tests/integration/test_keeper_dynamic_log_level/test.py`: master landed an equivalent fix for the same flakiness in #113938 (commit `0b51ec04cb06`), which replaces the fixed `time.sleep(3)` with a hand-rolled 60-attempt polling loop. Resolved in favour of this branch's version, which keeps the same polling semantics but is the cleaner form: it reuses the existing `wait_condition` helper instead of an open-coded loop, extracts `count_trace_messages` and `query_and_count_trace_messages`, and drops the host-wide `sync` call (flagged as a Major by the AI review - the poll and the `grep` run in the same container, so the page cache already makes the written log lines visible). So after this merge the branch no longer changes the test's behaviour relative to master; it only simplifies it.
Changelog category (leave one):
test_keeper_dynamic_log_level::test_adjust_log_levelwrote a new logger config, slept a fixed 3 seconds, and expected the asynchronous config reloader to have already applied thetracelevel. On slow runs (e.g. MSan) the reload had not happened yet, so the final assertion saw zero<Trace>lines in the log:https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=91062&sha=5bd33a1f41d843f69d93cb75e2192bb668e61368&name_0=PR&name_1=Integration%20tests%20%28amd_msan%2C%204%2F8%29
The fix polls for up to a minute (re-running the Keeper query each second) until trace logging becomes active, instead of relying on the fixed sleep.
Related: #91062