Skip to content

Keep nonce cleanup assertions on the fixture clock - #1015

Open
zlareb1 wants to merge 1 commit into
mainfrom
fix/native-nonce-cleanup-clock
Open

zlareb1 wants to merge 1 commit into
mainfrom
fix/native-nonce-cleanup-clock

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related: #735

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Native nonce-cleanup tests use an explicit phase clock while checking the original failure and exact session-close behavior.

Why

An expired cleanup allowance can legitimately terminate an owned session before public close starts. The nonce fixture requires exactly one public close but used the live clock for that allowance, so elapsed scheduling time could invalidate the assertion even when the original failure and write guards were preserved.

The fixture now supplies one manual clock to the control owner and Postgres cleanup. Both compare absolute deadlines in the same clock domain. The observed hosted failure's exact timing cause remains unknown; the controlled witness establishes the fixture's uncontrolled premise.

Scope and risk

The change adds the existing manual clock to one fixture. All 21 assertion expressions, the 0.5-second opening and exit allowances, and the real asynchronous waits and cancellation calls remain unchanged. The fixture's immediate fake close no longer depends on elapsed scheduling time. Deadline-specific sibling tests keep their existing clocks and behavior.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: reverting restores the live-clock fixture; no stored data or generated files change.

Tests

  • A three-case causal witness reuses the existing HTTP-first test and its assertions. It advances an ambient manual clock by one second when owned cleanup starts. Before the change, both owned cases fail at the exact-close assertion after the original-failure and no-write assertions; the unowned control passes. With the fixture clock, the same three cases pass. The cases cover an original fatal error, a normalized HTTP error and an unowned connection.
  • All 21 original assertion expressions are unchanged; whole-diff whitespace checks pass.
  • Eight additional selected existing cases were refused by the shared resource guard before execution and remain unrun locally. Hosted lint/type and format checks pass. The remaining required unit and integration CI checks are running. No broad local suite ran.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex prepared the fixture change and checked the owner cleanup contract, unchanged assertions and controlled failing/passing cases. Fresh independent whole-concern review on the published head reports no source findings or nits. The remaining required actual-source CI must pass before merge.

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

Checklist

  • Required format, lint, type and test CI checks pass on the final head.
  • No generated file, migration, plugin or frontend change is required.
  • Existing timeout values, cancellation calls and assertions remain intact.
  • Commits are signed off.

Use one manual phase clock for the control owner and Postgres cleanup so elapsed scheduling time cannot consume the fake close allowance. Preserve the original failure, exact close assertions and real task cancellation.

Signed-off-by: zlareb1 <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