Skip to content

fix(test): seed permission-import grants in index order so the 1M-row continuation test stays in budget - #10377

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/permission-import-cleanup-flake
Nov 24, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/permission-import-cleanup-flake

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • permission-import-cleanup.integration.ts › "preserves active and unexpired uploads while reclaiming abandoned rows across continuations" hit vitest's 30s timeout 4 times in recent runs (staging and unrelated PRs); passing CI runs took 13.6–28.1s. It must seed 1,000,001 grant rows, one more than the cleanup's per-run capacity (10,000 × 100), to force a continuation
  • The seed was 65–75% of the test's time. It used series::text as user_id, so '1', '10', '100'… arrive out of index order and every insert splits a random leaf of both text btrees (primary key and kcpig_subject_idx). Zero-padded ids (width from count, so they stay unique) insert in index order and both btrees append
  • Row counts, the per-run cap and every assertion are unchanged

Type of Change

  • Bug fix (test)

Testing

  • Seed insert alone, from Postgres's counters (load-independent): shared buffer touches 7.00M → 3.17M (−55%), WAL 335MB → 269MB, index size 152MB → 86MB. Bare psql: 5.6s with both indexes before vs 3.0s padded
  • Whole-test wall times on a heavily loaded host were noisy (5–27s for the same code); fresh-table batches went from 16.7–18.5s to 8.9–12.9s. This PR's integration shards are the next sample
  • biome

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 24, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 24, 2026 7:41pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

Changes the grant fixture to use zero-padded user IDs so inserts follow index order.

  • The cleanup test seeds grant IDs in text index order.

Reviews (1) · Last reviewed commit: "fix(test): seed permission-import grants..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit c53ae4b into staging Nov 24, 2026
65 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 8e04c6f6 Deployed Nov 24, 2026 by vercel[bot]
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