Skip to content

Prepared bot tests wait for enforced tenancy - #2106

Open
zlareb1 wants to merge 3 commits into
mainfrom
fix/prepared-bot-enforced-heartbeat
Open

zlareb1 wants to merge 3 commits into
mainfrom
fix/prepared-bot-enforced-heartbeat

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Related: #2057
Related: #2067

Changelog category

  • CI Fix or Improvement

Changelog entry

Not required.

Why

The prepared-bot test can start provisioning after general health turns ready while the first cell's web process still reads recording mode. The bot identity endpoint requires enforced mode and returns cell_unavailable during that window.

Scope and risk

Wait for the web process reached through the router to report enforced mode in its ClickHouse heartbeat. The fixture opens the heartbeat client within the readiness poll, so a transient ClickHouse connection error can be retried. Each request uses short timeouts and the fixture checks the original deadline before accepting the heartbeat. The test still proves both keys through the public router and checks registration, audit, and owned cleanup.

Compatibility, rollout and rollback

  • Wire and operator steps are unchanged.
  • Reverting restores the fixture's original readiness condition.

Tests

  • The same prepared-bot integration test failed on clean main and passed with the heartbeat wait, using Linux, ClickHouse 26.11.9.22, and Postgres 18 with a synchronous standby. Command with those stores configured: LOOM_ENV_FILE= .venv/bin/python -m pytest -q tests/integration/test_cell_prepared_bot_native.py::test_normal_prepared_later_cell_proves_both_bootstrap_keys.
  • An injected transient client-construction error fails before the change. With the change the same check retries, reads the heartbeat for the requested instance, and closes the client.
  • make lint, make typecheck, and the changed file's Ruff format check passed on the tested commit.
  • The full-tree Biome gate also reports the same dashboard formatting failure on main. #2107 repairs that assertion.

AI assistance in the code

  • AI-generated (Codex wrote the fixture change). The integration run checks live readiness, both keys, audit rows, and process retirement.

Checklist

  • Focused validation, lint, and type checks pass.
  • No generated files, migrations, shipped plugin files, or frontend files change.
  • The commit is signed off.

General health permits recording mode while the bot identity check requires the serving process to have read enforced mode. Wait for that process to report the transition before provisioning.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 3, 2026 7:30pm UTC
loom-telemetry Ready Ready Preview Dec 3, 2026 7:30pm UTC

Request Review

Use a short-lived readiness client with bounded connect and read timeouts. Ignore a heartbeat that arrives after the preparation deadline.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Open the heartbeat client within the existing readiness poll.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant