Skip to content

Postgres retirement tests use a virtual cleanup clock - #2067

Open
zlareb1 wants to merge 2 commits into
mainfrom
fix/ci-pg-retirement-test-clock
Open

zlareb1 wants to merge 2 commits into
mainfrom
fix/ci-pg-retirement-test-clock

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Related: #2062

Changelog category

CI Fix or Improvement

Why

The Postgres retirement tests use a 40 ms command cleanup budget with fake connections. A runner pause while the fake reads authority metadata can use up that budget before settlement is verified. The timeout reproduces on clean main and on the failed CI merge.

Scope and risk

The settlement fixture and the ownership tests that reuse it read deadlines from the event loop's test clock. Waiting for timers advances time, so cleanup deadlines still expire. The acknowledgment, cancellation, certificate, and no-certificate assertions keep their original bounds.

Compatibility, rollout and rollback

No wire changes or operator steps. Reverting restores wall-clock timing in the tests.

Tests

  • A 60 ms pause in the fake authority read on Linux with Python 3.12.16 reproduces the original timeout on clean main and the tested merge.
  • A pause before the repeated-cancellation ownership test reproduces the deadline assertion failure on the first repair commit.
  • All 52 ownership and settlement tests pass on Linux with the ownership pause. Local format, lint, type checks, and git diff --check pass.

AI assistance in the code

AI-generated (Codex). The agent reproduced the failures and ran the focused suites and local gates.

Checklist

  • Local format, lint, type checks and focused tests pass.
  • Commits are signed off.

A pause in the test runner can consume the command cleanup budget while the fake authority prepares its response.

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 12:44pm UTC
loom-telemetry Ready Ready Preview Dec 3, 2026 12:44pm UTC

Request Review

The shared settlement fixture gives the event loop and the cleanup code a virtual clock. Calculate the ownership deadlines on that clock so elapsed runner time cannot extend or shorten the tested budget.

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