Skip to content

Revert "Revert "Remove test_storage_nats"" - #93616

Merged
alexey-milovidov merged 1 commit into
masterfrom
revert-92155-revert-92140-remove-test-nats
Jan 7, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
revert-92155-revert-92140-remove-test-nats

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Reverts #92155

Failed in #93602

@alexey-milovidov alexey-milovidov self-assigned this Jan 7, 2026
@alexey-milovidov
alexey-milovidov merged commit f579bf8 into master Jan 7, 2026
1 check failed
@alexey-milovidov
alexey-milovidov deleted the revert-92155-revert-92140-remove-test-nats branch January 7, 2026 17:56
@clickhouse-gh

clickhouse-gh Bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9d48e5a]

Summary: ⏳

job_name test_name status info comment
Config Workflow failure
python3 ./ci/jobs/scripts/workflow_hooks/store_data.py failure
Dockers Build (amd) dropped
Dockers Build (arm) dropped
Dockers Build (multiplatform manifest) dropped
Style check dropped
Docs check dropped
Fast test dropped
Build (arm_tidy) dropped
Build (amd_debug) dropped
Build (amd_asan) dropped

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jan 7, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 7, 2026
@nikitamikhaylov nikitamikhaylov added the post-approved Approved, but after the PR is merged. label Mar 27, 2026
pull Bot pushed a commit to AKJUS/ClickHouse that referenced this pull request Jul 30, 2026
`tests/integration/test_storage_nats/test_nats_core.py` and
`test_nats_jet_stream.py`, together with `common.py`, the test configs, the
Protobuf schema and the JSON reference, were removed in
ClickHouse#93616 - a re-removal of
ClickHouse#92140 after
ClickHouse#92155 had restored them. Restore
them and fix what has drifted since, so that they pass instead of timing out.

Four things had to be reconciled with the current `master`:

- Waiting for the consumer, not just for the view. Refusing a direct `SELECT`
  only proves that a materialized view is attached; the background streaming
  task subscribes to the subjects a moment later. Core NATS has no backlog, so
  messages published in that window are dropped and never reach the view - for
  example `test_nats_select` published 50 messages at `15:30:52.179` while the
  consumer subscribed at `15:30:52.215`, and then asserted on an empty view.
  `wait_for_mv_attached_to_table` now also waits for a fresh
  `Started streaming to N attached views` line, which the background task logs
  right after the consumer has subscribed. This is the same barrier
  `test_system_stop.py` already uses.

- `configs/nats.xml` and `nats_certs.sh` reappeared in `master` with
  ClickHouse#107476, which added
  `test_system_stop.py` to the same directory. Keep those versions and re-add
  the `<nats>` credentials that the restored tests rely on to `nats.xml`.

- `check_nats_is_available` no longer hangs on an unusable broker.
  `nats.connect` reports a TLS or an authentication failure through its error
  callback and then keeps retrying, so every NATS test ran into the 900 s pytest
  timeout with no indication of the cause - this is what all seven integration
  jobs of ClickHouse#100913 hit, because
  `ssl.create_default_context` enables `VERIFY_X509_STRICT` since Python 3.13
  (the test images switched in d308407, after the tests were removed) and
  the certificate of the time was rejected with `CA cert does not include key
  usage extension`. The certificate is already fixed in `master`; bound the
  connect attempt as well and log what the client saw.

- The `ruff` rules F401 (unused import) and F541 (`f`-string without
  placeholders) were enabled after the tests were removed, so drop the unused
  imports and the extraneous `f` prefixes. One expected error message lost its
  trailing period in the meantime, adjust the assertion accordingly.

Verified locally against a `master` release binary: both modules pass in full,
33 tests each.

Related: ClickHouse#100913

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

Labels

post-approved Approved, but after the PR is merged. pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants