Repository navigation
Fix flaky test_keeper_dynamic_log_level - #113571
Conversation
The test wrote a `logger.xml` with `<level>trace</level>`, slept for three seconds, ran one query, and asserted that the log holds at least one `<Trace>` message. `ConfigReloader::run` waits for `config_reload_interval_ms` (2 seconds by default) and only then re-reads the whole configuration, so the gap between writing the file and the new level taking effect is that interval plus the duration of a full config reload, not the interval alone. Under MSan on a loaded runner that exceeds three seconds: the query then runs while the level is still `warning`, nothing is logged at `Trace`, and the assertion fails with `assert 0 >= 1`. Wait for the level to be applied instead of sleeping for a fixed time. The query is issued on every attempt, because the query is what produces the `Trace` messages the test looks for. The same failure happened on `master` at `9d0b1a25ba7aa4579c95a65baca002d1dd7a1e47`, so it is not specific to any pull request. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113224&sha=297082adba654b8bafac191c6c61b5023bcc76ef&name_0=PR&name_1=Integration%20tests%20%28amd_msan%2C%203%2F8%29 #113224 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [2d05e56] Summary: ✅ AI ReviewSummaryThis PR now differs from Final VerdictStatus: ✅ Approve |
ColumnArray::insertManyDefaults and ColumnString::insertManyDefaults
#113577
The server and the `grep` run in the same container and kernel, so log writes are visible through the page cache immediately; a host-wide filesystem flush per retry only adds I/O pressure on loaded runners. Co-Authored-By: Claude Fable 5 <[email protected]>
…er-dynamic-log-level
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 units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
alexey-milovidov
left a comment
There was a problem hiding this comment.
Thanks! Can't believe we used to have such a bad test. Every sleep is a red flag, and if not accompanied with a check in a loop, it can't be right.
…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.
|
🕵 Merged Note for whoever merges this: an equivalent fix for the same flakiness landed on
If you would rather keep |
Picks up ef9be38 (ClickHouse#113571, 'Fix flaky test_keeper_dynamic_log_level'), which was the sole remaining red on this branch's CI and is unrelated to this change.
Related: #113224
test_keeper_dynamic_log_level/test.py::test_adjust_log_levelwrites alogger.xmlwith<level>trace</level>, sleeps for three seconds, runs one query, and asserts that the log holds at least one<Trace>message:ConfigReloader::runwaits forconfig_reload_interval_ms(2 seconds by default) and only then re-reads the whole configuration, so the gap between writing the file and the new level taking effect is that interval plus the duration of a full config reload, not the interval alone. Under MSan on a loaded runner that exceeds three seconds: the query runs while the level is stillwarning, nothing is logged atTrace, and the assertion fails.The test now waits for the level to be applied instead of sleeping for a fixed time. The query is issued on every attempt, because the query is what produces the
Tracemessages the test looks for.This is not specific to any pull request. The same failure, with the same message and on the same
Integration tests (amd_msan, 3/8)shard, happened onmasterat9d0b1a25ba7aa4579c95a65baca002d1dd7a1e47about six hours earlier. It is rare - one failure in 11425 runs of this test onmasterover the last 90 days - and I did not find an open issue for it.The test passed on retry within the same run, so the failure carries the
retry_oklabel, but that label is only downgraded to a success for the coverage job, so on every other shard it still turns the job red.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113224&sha=297082adba654b8bafac191c6c61b5023bcc76ef&name_0=PR&name_1=Integration%20tests%20%28amd_msan%2C%203%2F8%29
Changelog category (leave one):
Version info
26.8.1.1103(included in26.8and later)