Deflake test_zookeeper_connection_log
Deflakes tests/integration/test_zookeeper_connection_log/test.py by tolerating nondeterminism (duplicate identical connection events, env-only feature flags).
Root Cause (from CI logs):
- Duplicate initial connect row (same logical event twice):
node1 Connected default zoo1 … Initialization
node1 Connected default zoo1 … Initialization <-- duplicate in actual
node1 Connected zk_conn_log_test_2 zoo2 … Initialization
- Feature flags drift (env/build-specific):
ACTUAL: ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE','MULTI_WATCHES','CREATE_WITH_STATS']
EXPECTED: ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE','MULTI_WATCHES']
- Unstable Connection explains duplicates:
Zookeeper connection established, state: CONNECTED
Connection dropped: socket connection broken
Transition to CONNECTING
Zookeeper connection lost
…
Zookeeper connection established, state: CONNECTED
Closes https://github.com/ClickHouse/ClickHouse/issues/91028
Changelog category (leave one):
- Not for changelog (changelog entry is not required)
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
- [ ] Documentation is written (mandatory for new features)
@zlareb1, first of all, thanks for taking care of this test, I should have done it, but I missed it.
Second, I have a question about the duplicates, probably you understood it better than me from the first look, but if the connection drops because of unstable networking, why don't we register a disconnect? Having two connection events without a disconnect seems kind of interesting. It is not the end of the world, but I think I would have a look into it, unless you found something that prevents me from doing that.
Second, I have a question about the duplicates, probably you understood it better than me from the first look, but if the connection drops because of unstable networking, why don't we register a disconnect? Having two connection events without a disconnect seems kind of interesting.
On the duplicates: in this run we do have two “Connected … Initialization” rows for default, and the Disconnected … Config changed for default shows up later.
node1 Connected default zoo1 2181 ... Initialization
node1 Connected default zoo1 2181 ... Initialization <-- second Connected
...
node1 Disconnected default zoo1 2181 ... Config changed
I’ve included diagnostic logs to assist with debugging in CI.
- Full output with client_id
- Grouped summary: count(), groupArray(client_id) per (hostname,type,name,host,port,reason)
I think I would have a look into it, unless you found something that prevents me from doing that.
@antaljanosbenjamin, please feel free to examine it. The recently added logs may help with debugging.