Skip to content

Repository expiry tests measure simulated idle time - #1045

Closed
zlareb1 wants to merge 2 commits into
mainfrom
fix/repo-expiry-idle-clock
Closed

zlareb1 wants to merge 2 commits into
mainfrom
fix/repo-expiry-idle-clock

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related: #1076

Changelog category

  • CI Fix or Improvement

Changelog entry

Not required.

Why

The repository-search expiry test can exhaust its outer watchdog during the initial search, before reaching the intentional expiry transition. These cases check cancellation and permission renewal independently of CPU scheduling latency.

Scope and risk

Replicated-erasure lease provisioning and its unit regression controls are on main. This branch preserves them unchanged. It also scopes person-query observations to the authorization decision, retaining unbounded-read negative controls. No production authorization, lease or erasure rule changes.

The clock change stays in one unit-test file. Only the two repository renewal cases use private function loops. Their loop clocks advance during selector waits; their separate repository clocks still advance explicitly at the proof boundary. The outer watchdog measures simulated idle time and still cancels a blocked await. Teardown drains and rejects newly pending tasks.

Every existing test body, assertion and deadline value is retained. Product behavior and shared test helpers are unchanged.

Compatibility, rollout and rollback

  • Wire, schema, configuration and operator steps: none.
  • Rollback: revert the fixture change. 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.

  • .venv/bin/python -m pytest -q tests/unit/test_source_repo_search.py: 23 passed.
  • Scoped Ruff lint and format checks, existing test-body comparisons 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 change and checked its clock boundaries, cancellation controls and task cleanup.

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

Checklist

  • Existing assertions and deadline values are retained.
  • No production code, generated interfaces, migrations 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:11am UTC

Request Review

@zlareb1
zlareb1 force-pushed the fix/repo-expiry-idle-clock branch from ca2f5bf to fd424a3 Compare November 20, 2026 13:55
@zlareb1
zlareb1 force-pushed the fix/repo-expiry-idle-clock branch 3 times, most recently from 54cdeaa to 34a063d Compare November 20, 2026 23:05
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/repo-expiry-idle-clock branch from 34a063d to 81436b8 Compare November 21, 2026 00:08
zlareb1 added a commit that referenced this pull request Nov 21, 2026
Source: 81436b8 (PR #1045). The shared person-query fixture files already match that reviewed head.
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
zlareb1 added a commit that referenced this pull request Nov 21, 2026
Source: 81436b8 (PR #1045). The shared person-query fixture files already match that reviewed head.
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
zlareb1 added a commit that referenced this pull request Nov 21, 2026
Source: 81436b8 (PR #1045). The shared person-query fixture files already match that reviewed head.
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
zlareb1 added a commit that referenced this pull request Nov 21, 2026
Related: #1045
Related: #1100

### Changelog category

- CI Fix or Improvement

### Why

The person-decision integration fixture wraps a shared client and records unrelated background reads. A schema watcher uses an independent context and can omit a default read timeout. Capture only the decision query tag observed at entry, while retaining decision reads with no timeout so the finite-budget assertion can reject them.

### Scope and risk

Both query methods retain the original finite-budget assertion. Ten controls cover concurrent schema reads, unbounded decision reads and the real decision reader with a fake driver. The earlier hosted log does not identify its offending SQL; these controls reproduce the capture defect without establishing a unique cause for that run.

The two repository renewal cases use a private function loop whose watchdog clock advances during selector waits. Repository expiry stays separate. Original bodies, the 5 ms expiry, 100 ms watchdog, cancellation cleanup and base-proof assertions remain.

The claim-cancellation test module composes the reviewed diagnostic observer from #1100. On failure it records fixed task and waiter booleans within the existing privacy and byte limits. Two event-driven controls distinguish cancellation awaiting task resumption from cancellation consumed before another pending wait. Original claim assertions, input handling, signal delivery and deadlines remain unchanged. The natural cancellation failure's cause remains unknown; this adds evidence and does not repair cancellation.

### Compatibility, rollout and rollback

Only test fixtures and their controls change. Production code, wire fields, settings, schema and operator steps remain unchanged. Reverting restores the previous test fixtures. No stored data changes.

### Tests

On this current-main head, 36 directly related SCIM query, replicated-erasure and repository-expiry cases pass. Five pure claim observer and privacy controls also pass; no real claim subprocess or signal-race test ran locally. Scoped Ruff, formatting, public-body prose and committed-range whitespace checks pass.

Earlier fail-first capture and observer receipts remain prior-source evidence. They are not new runs on this head. All three prior concern files retain their exact reviewed bytes and modes; the claim module exactly matches #1100. The complete tree is current main plus these four files. Full hosted CI, including the actual-client integration and claim cancellation cases, and a fresh independent whole review remain required for this exact head.

### AI assistance in the code

- AI-generated: Codex prepared the fixture corrections and diagnostic controls.

- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [ ] Full required hosted checks pass on this head.
- [x] Production budgets, assertions and diagnostic limits remain unchanged.
- [x] No generated files or operator steps are required.
- [x] Commits are signed off.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1 zlareb1 closed this Nov 21, 2026
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