Files
datastore/programs
Alexey MilovidovandClaude Opus 4.6 9ebf3853be Fix race condition in KeeperClient.execute_query causing flaky test_rm_with_version
The `execute_query` method in the Python test helper uses `epoll` to
read from both stdout and stderr of the keeper-client process. When
a command fails, the keeper-client writes the error to stderr and then
the separator to stdout. However, when both events arrive simultaneously
in `epoll.poll()`, the loop could process stdout first, find the
separator, and return successfully without ever reading the pending
stderr error data - causing the exception to be silently swallowed.

Fix both sides:
- C++ (`KeeperClient.cpp`): flush stderr before writing the stdout
  separator, ensuring error data is in the pipe buffer first.
- Python (`keeper_utils.py`): process stderr events before stdout
  events in the poll loop, so errors are always collected before
  checking the separator.

Also fix test cleanup: add `try/finally` with `drop_node_if_exists`
to `test_rm_with_version` and `test_rm_without_version`, and give
`test_rm_without_version` its own unique node path instead of
reusing `/test_rm_with_version_node`.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97554&sha=3f86a6142c6920239c1b3adedfe82ccb5fcd6515&name_0=PR&name_1=Integration%20tests%20%28amd_binary%2C%204%2F5%29

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-22 21:17:51 +01:00
..
2026-02-08 00:14:02 +01:00
2026-01-12 12:27:55 +01:00