Skip to content

Cleanup tests measure their shared idle deadline - #1087

Open
zlareb1 wants to merge 2 commits into
mainfrom
fix/cell-close-cleanup-clock
Open

zlareb1 wants to merge 2 commits into
mainfrom
fix/cell-close-cleanup-clock

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related: #1076

Related: #1041

Changelog category

  • CI Fix or Improvement

Changelog entry

Not required.

Why

The cleanup allowance test uses a real monotonic stopwatch around an inert connection close that intentionally never finishes. A scheduler delay can spend that stopwatch's budget independently of the cleanup protocol. A controlled advance in the independent monotonic clock reproduces this dependency.

The hosted failure measured about 159 ms against its 150 ms bound. The cause of that particular overrun remains unknown. This change fixes the independently reproduced clock dependency.

Scope and risk

Replicated-erasure lease provisioning and its unit regression controls are on main. This branch preserves them unchanged. No production lease or erasure rule changes. The person-query recorder selects decision-tagged reads and retains unbounded-read negative controls.

The cleanup unit-test file and two person-query fixture/regression files change. Only the cleanup allowance case and its clock controls use a private function loop. Its loop, cleanup owner, connection-close budget and elapsed-time assertion share one clock that advances during selector waits. The test measures elapsed idle time during the bounded cleanup protocol. Fixture teardown drains and rejects newly pending tasks.

Every existing test body, assertion and deadline value is retained, including the 30 ms cleanup allowance and 150 ms elapsed bound. A control checks that the blocked close still expires after 30 ms. The other cases keep their existing loop scopes. Production code and shared test helpers are unchanged.

Compatibility, rollout and rollback

  • Wire, schema, settings and operator steps: none.
  • Rollback: revert the fixture and its controls. No persisted data changes.

Tests

This head matches the exact three-way composition of the preceding qualified source and current main. The erasure fixture and its canonical unit regression module are inherited from main. On this composed head, all three erasure unit cases, scoped Ruff, Python formatting, committed-range whitespace and public-body prose checks pass. Full required hosted CI and a fresh independent whole review remain required for this exact head.

env LOOM_ENV_FILE= .venv/bin/python -m pytest tests/unit/test_erasure_replicated_fixture.py -q

Earlier feature qualification

The following feature-specific results were recorded before this composition. They are prior-source receipts, not new tests of this composed head.

  • Before the fixture change, the controlled regression produced one failure and one pass: advancing the independent clock by 160 ms failed the original elapsed-time assertion; the zero-delay control passed.
  • After the fixture change, the identical regression command and test body pass both cases.
  • LOOM_ENV_FILE= .venv/bin/python -m pytest -q tests/unit/test_cell_attach_cleanup.py: nine passed.
  • Scoped Ruff lint and format, existing test-body preservation, production-source and diff whitespace checks pass.
  • Full exact-head hosted CI must pass before merge.

AI assistance in the code

  • AI-generated: Codex wrote the fixture and controls, then checked deadline coherence, retained assertions and task cleanup.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Existing test bodies, assertions and deadline values are retained.
  • No production source, generated interfaces, schema or operator settings change.
  • Commits are signed off.
  • Full exact-head GitHub CI passes.

@vercel

vercel Bot commented Nov 20, 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 Nov 21, 2026 12:09am UTC

Request Review

Keep the blocked close, deadline observers and loop timers on one private
clock. A controlled independent clock advance reproduces the elapsed-time
dependency while the original cleanup and refusal assertions stay intact.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Shared client schema reads run with an independent context. Record only decision-tagged statements while retaining unbounded decision reads as failures.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
(cherry picked from commit 57327d5)
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 force-pushed the fix/cell-close-cleanup-clock branch from 24feba9 to 721f3ee Compare November 21, 2026 00:08

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