Skip to content

Drive placement deadline tests with a private clock - #1039

Closed
zlareb1 wants to merge 1 commit into
mainfrom
fix/cell-http-test-virtual-clock
Closed

zlareb1 wants to merge 1 commit into
mainfrom
fix/cell-http-test-virtual-clock

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026

Copy link
Copy Markdown
Member

Related: #1019

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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):

Not applicable.

Why

The placement exchange fixture mixes a frozen close clock with real event-loop timers. Its simulated reply takes 40 ms against a 75 ms work timer, so scheduling delays can expire a reply that the test models as timely. The current fixture failed both a timely refusal and the wait for response cancellation in a main CI run. The exact source of the elapsed scheduling delay is unmeasured.

The fixture gives each case a private event loop and one manual clock for its timers and owned close. The selector advances that clock by its idle timeout, then polls without waiting. The simulated reply, streaming reads, work timeout and cancellation waiter keep their existing durations and ordering. CPU scheduling does not spend their simulated allowance.

Scope and risk

One unit fixture changes. The six cases and both complete test functions retain their assertions and literal bounds. Response parsing and client exit still use the existing inert transport. The real elapsed-time assertion remains. A teardown census cancels and joins any task left on the private loop and fails if it finds one; the shared session-loop cleanup guard is unchanged.

The fixture uses the selector interface of its private event loop. Independent review and hosted execution must verify timer ordering and teardown. This change does not establish a production performance improvement or a cause for other acceptance failures.

Compatibility, rollout and rollback

  • Wire and defaults: none.
  • Operator steps: none.
  • Rollback: reverting changes the unit fixture only; no stored data or generated files are involved.

Tests

  • The linked main job records the two failures before this change.
  • Static syntax, complete original test-function AST comparison and git diff --check pass. All six parameter cases remain.
  • Focused execution, formatting, lint and the public-text checker are unrun locally: the required resource recovery has not occurred. No dependency installation or alternate test environment was used.
  • Fresh independent whole-change review and complete exact-head CI are required before merge. A prior passing run is not qualification for this head.

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

  • AI-generated: Codex wrote the fixture change and checked its scope against the original cases and failure evidence.

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

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • No generated files change.
  • No migration changes.
  • No plugin behaviour changes.
  • No frontend changes.
  • No operator or wire changes.
  • Repository text contains no deployment details.
  • Commits are signed off.

Use one idle-driven clock for the mock exchange timers and owned close. Keep the six cases and their bounds, with a private-loop task census at teardown.

Signed-off-by: zlareb1 <[email protected]>
@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
loom-docs Ignored Ignored Nov 20, 2026 12:36pm UTC

Request Review

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