Skip to content

Hook contract cleanup waits for detached jobs - #1090

Open
zlareb1 wants to merge 2 commits into
mainfrom
fix/hook-contract-sandbox-drain
Open

zlareb1 wants to merge 2 commits into
mainfrom
fix/hook-contract-sandbox-drain

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Changelog category

  • CI Fix or Improvement

Changelog entry

Not required.

Why

Hook contract tests remove their sandbox after the immediate hook exits. A detached flusher can still be writing there. The fixture waits for its owned job files to disappear before removing the sandbox; the flusher removes each job after its cursor and recording writes.

Scope and risk

Only the hook contract test's six cleanup sites and a test helper change. A controlled detached writer demonstrates premature removal, and the real flusher runs behind a response barrier. An unfinished job fails cleanup after a separate 45-second teardown bound. There is no removal retry, disabled delivery or production hook change.

All existing cases, inputs, concurrency, output assertions and measured hook deadlines remain byte-identical. The original hosted failure's particular late writer remains unknown; the regression proves the reachable ownership race.

Compatibility, rollout and rollback

No wire, settings, plugin version, shipped hook or operator changes. Reverting changes only test cleanup.

Tests

All six selected hook cleanup, unreachable-server and isolated-home import cases pass on this composition. Syntax, Biome formatting, public prose and committed-range whitespace checks pass. The source tree equals the expected three-way composition with main; every prior concern file retains its exact Git blob and mode. The earlier full CI result belongs to the previous public head. This head requires a new independent whole review and full hosted CI before merge.

Prior-head source evidence

The extracted original cleanup fails two regression cases and passes the empty-job control. All four cleanup cases pass after the fix, including the real detached flusher and unfinished-job refusal. The original unreachable/unauthorized/hanging-server contract case and suite-wide isolated-home import contract also pass with their unchanged assertions. New child processes use the existing cross-platform environment helper. Scoped syntax, Biome, prose and whitespace checks pass. Full hosted CI and fresh independent whole review are required before merge.

AI assistance in the code

  • AI-generated: Codex wrote the fixture helper and regression tests.
  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Full hosted CI passes on the final head.
  • Fresh independent whole review is complete on the final head.
  • Production deadlines and all original contract assertions remain unchanged.
  • 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 1:27am UTC

Request Review

@zlareb1
zlareb1 force-pushed the fix/hook-contract-sandbox-drain branch from f1a5ac7 to 334a924 Compare November 20, 2026 23:43
@zlareb1
zlareb1 force-pushed the fix/hook-contract-sandbox-drain branch from 334a924 to e9a7dd2 Compare November 21, 2026 00:04
Keep each test sandbox until its detached flusher removes its final job marker. Preserve hook deadlines and verify unfinished jobs refuse cleanup.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 force-pushed the fix/hook-contract-sandbox-drain branch from e9a7dd2 to 4415724 Compare November 21, 2026 01:24

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