Skip to content

Fix flaky test_strict_reject_with_config - #93539

Merged
tiandiwonder merged 1 commit into
ClickHouse:masterfrom
tiandiwonder:fix_flaky_test_strict_reject_with_config
Jan 12, 2026
Merged

tiandiwonder merged 1 commit into
ClickHouse:masterfrom
tiandiwonder:fix_flaky_test_strict_reject_with_config

Conversation

@tiandiwonder

@tiandiwonder tiandiwonder commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Fix flaky test_strict_reject_with_config. fix #91667

Changelog category (leave one):

  • CI Fix or Improvement (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)

Version info

  • Merged into: 26.1.1.435

@tiandiwonder tiandiwonder added the can be tested Allows running workflows for external contributors label Jan 7, 2026
@tiandiwonder
tiandiwonder requested a review from Copilot January 7, 2026 00:34
@clickhouse-gh

clickhouse-gh Bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8e4b0c4]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_asan, db disk, old analyzer, 2/6) failure
test_keeper_snapshots/test.py::test_invalid_snapshot FAIL cidb, issue ISSUE EXISTS
test_keeper_snapshots/test.py::test_snapshot_size FAIL cidb IGNORED
Integration tests (amd_binary, 3/5) failure
test_keeper_snapshots/test.py::test_invalid_snapshot FAIL cidb, issue ISSUE EXISTS
test_keeper_snapshots/test.py::test_snapshot_size FAIL cidb IGNORED
Integration tests (amd_binary, 5/5) failure
test_keeper_invalid_digest/test.py::test_keeper_invalid_digest FAIL cidb, issue ISSUE EXISTS
Integration tests (arm_binary, distributed plan, 2/4) failure
test_keeper_snapshots/test.py::test_invalid_snapshot FAIL cidb, issue ISSUE EXISTS
test_keeper_snapshots/test.py::test_snapshot_size FAIL cidb IGNORED
test_projection_rebuild_with_required_columns/test.py::test_projection_rebuild_uses_only_required_columns FAIL cidb, issue ISSUE EXISTS
Integration tests (arm_binary, distributed plan, 3/4) failure
test_keeper_invalid_digest/test.py::test_keeper_invalid_digest FAIL cidb, issue ISSUE EXISTS
Integration tests (amd_tsan, 6/6) failure
test_keeper_snapshots/test.py::test_invalid_snapshot FAIL cidb, issue ISSUE EXISTS
test_keeper_snapshots/test.py::test_snapshot_size FAIL cidb IGNORED

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jan 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a flaky integration test by addressing a race condition in SSL handshake error detection. The test test_strict_reject_with_config was failing intermittently because it expected a specific error message, but depending on timing, the SSL connection could be reset before the alert was transmitted.

  • Modified test assertion to accept two possible error messages resulting from the SSL handshake race condition

@hanfei1991 hanfei1991 self-assigned this Jan 7, 2026
@tiandiwonder
tiandiwonder added this pull request to the merge queue Jan 12, 2026
Merged via the queue into ClickHouse:master with commit 856f0ef Jan 12, 2026
121 of 128 checks passed
@tiandiwonder
tiandiwonder deleted the fix_flaky_test_strict_reject_with_config branch January 12, 2026 11:37
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 12, 2026
kute1654 pushed a commit to kute1654/ClickHouse that referenced this pull request Oct 10, 2026
The strict server rejects a client that sends no certificate. Under TLS 1.3
the client finishes its handshake before the server checks the client
certificate, so it writes its native Hello right away. The server tears the
failed session down with shutdown(SHUT_RDWR) (FIN) followed by close() with
the client's Finished record still unread (RST), so the client receives
alert, FIN, RST. If its Hello write comes after both, the RST hits a socket
in CLOSE_WAIT, the kernel reports EPIPE, and the client fails with
"I/O error: Broken pipe, while writing to socket" without reading the alert.

Before the orderly shutdown for sessions that died with a fatal error
(ClickHouse#116692) the teardown was RST only, which gives ECONNRESET, the case ClickHouse#93539
already accepts. Which TCP event reaches the client first is not what the
test checks: it checks that the connection is refused. pytest.raises still
fails the test if the connection is accepted, and the message list still
excludes a client-side verification failure.

Seen twice on the 26.3 release branch (amd_tsan) after the ClickHouse#116692 backport.
Forcing a 300 ms delay on every client socket write with strace reproduces
the CI message 5/5 on 26.3.43.4 and on master, and gives "Connection reset
by peer" on 26.3.33.24 (before the backport).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test_accept_invalid_certificate/test.py::test_strict_reject_with_config

4 participants