Skip to content

Private-query capture tests isolate their request context - #1089

Open
zlareb1 wants to merge 1 commit into
mainfrom
fix/private-log-capture-observation
Open

zlareb1 wants to merge 1 commit into
mainfrom
fix/private-log-capture-observation

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

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

Changelog entry

Not required.

Why

The private native-query test observes a process-wide capture file while awaiting one private query. A public query from an existing task can create that file and fail the private-capture assertion without capturing private SQL. An event-controlled unit harness reproduces this through the original integration coroutine; the failing file contains only the unrelated public statement. The writer responsible for the original hosted failure remains unknown.

The fixture scopes its observation with an inherited context variable. The request and its child tasks retain the capture boundary; unrelated tasks keep the original capture sink. Forced private captures from the request or a child still fail the original absence assertion.

Scope and risk

Only the integration test's capture observer and its unit regression change. The private result, file-absence assertion, public capture control, native query-log proof, SQL-user permissions and insights permissions remain unchanged. The unit harness stops before native database checks; it does not qualify those checks locally.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: reverting removes only test code.

Tests

This head matches the exact three-way composition of the preceding qualified source and current main. The erasure fixture and its canonical unit regression module are inherited from main. On this composed head, all three erasure unit cases, scoped Ruff, Python formatting, committed-range whitespace and public-body prose checks pass. Full required hosted CI and a fresh independent whole review remain required for this exact head.

env LOOM_ENV_FILE= .venv-312/bin/python -m pytest tests/unit/test_erasure_replicated_fixture.py -q

Earlier feature qualification

The following feature-specific results were recorded before this composition. They are prior-source receipts, not new tests of this composed head.

  • Before the fixture change, the six-case regression produced two failures at the original absence assertion and four passes. Both failing files contain only unrelated public SQL.
  • The same six cases pass after the change, including forced private captures from the request and an inherited child.
  • Eleven focused capture checks pass. Scoped Ruff, formatting, prose and whitespace checks pass; an AST comparison preserves all thirteen integration assertions and the native-query-log and permission checks. Full hosted CI and an independent review of the pushed head remain required.

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

  • AI-generated: Codex wrote the test fixture and regression. Source review checks the inherited privacy scope, original sink preservation and unchanged native and permission assertions.

  • 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 pushed head.
  • A fresh independent whole-diff review is complete on the final pushed head.
  • 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:09am UTC

Request Review

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 force-pushed the fix/private-log-capture-observation branch from 5a604a2 to 0f5fe33 Compare November 21, 2026 00:08

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