Skip to content

Graph stats cancellation test uses a private idle clock - #1091

Open
zlareb1 wants to merge 1 commit into
mainfrom
fix/graph-stats-pass-clock
Open

zlareb1 wants to merge 1 commit into
mainfrom
fix/graph-stats-pass-clock

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related: #1009

Changelog category (leave one):

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

Changelog entry

The graph-stats cancellation fixture uses an idle clock for its pass deadline.

Why

The pass timeout starts before the cheap legs reach the blocked unit-risk query. Unrelated scheduling time can exhaust that allowance before the fixture observes its in-flight signal. The hosted failure occurs at the two-second signal watchdog; the actual scheduling cause of that run is unknown. A controlled monotonic jump independently reproduces this wall-clock dependency.

Scope and risk

One existing test module changes. The cancellation case and its controls use a private function loop with the existing manual clock. Pure calculations run inline through the fixture's thread-offload seam, with the original functions, arguments and results. The fixture therefore controls both loop time and executor scheduling while the real graph-stats pass, repository fake and cancellation paths run.

The original test body retains its 0.2-second pass deadline, two-second signal watchdog, five 0.01-second post-cancellation waits, two namespaces, statement-count freeze and completed cheap-leg assertions. Teardown cancels and drains unexpected tasks and rejects leaks. A negative control observes cancellation of a genuinely blocked edge query at the unchanged 0.2-second deadline and checks the complete 0.25-second logical timeline through the original freeze assertions. Independent review must assess the fixture's scheduling coverage.

Compatibility, rollout and rollback

  • Wire: no operations, fields or defaults change.
  • Operator steps: none. No production code, configuration, migration or stored data changes.
  • Rollback: reverting restores the prior test clock.

Tests

Prior source qualification on Python 3.12 with the declared development and code extras showed that the controlled scheduler regression fails its 0.25-second jump case and passes its zero-jump control before the fixture fix. The identical command passed both cases afterward:

LOOM_ENV_FILE= .venv/bin/python -m pytest tests/unit/test_code_graph_stats_pass_budget.py -k pass_deadline_fixture_ignores_external_scheduler_elapsed -q

On the composed head, the complete directly related module passes all 24 cases, including the blocked-query deadline control. Scoped Ruff, Python formatting and whitespace checks pass. Full exact-head hosted CI and fresh independent whole review remain required before merge. No database, provider, runtime or benchmark was started.

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

  • AI-generated: Codex diagnosed the timing dependency, wrote the scoped fixture and checked preservation of the original test bodies.

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

Checklist

  • Full required hosted CI passes on this head.
  • Original deadlines, inputs and behavior assertions are preserved.
  • No generated, wire, schema, plugin, frontend or operator documentation change is required.
  • Commits are signed off.

@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:21am UTC

Request Review

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 force-pushed the fix/graph-stats-pass-clock branch from 5e2e751 to 4a183d8 Compare November 21, 2026 00:19
@zlareb1 zlareb1 mentioned this pull request Nov 21, 2026
4 of 5 tasks

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