Skip to content

test(history): stale-ledger build case fails on Windows (ino + 1 loses precision) - #7087

Merged
lidge-jun merged 1 commit into
devfrom
fix/history-rebuild-stale-test-windows-ino
Oct 14, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/history-rebuild-stale-test-windows-ino

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

The Windows shard of Cross-platform CI on dev (run 38499932279, shard 5/9, head 04b7d51) fails in tests/usage/request-history-rebuild-worker.test.ts › "a build whose ledger is not the recorded file fails stale and leaves no file": buildIndexFile returned 10 rows instead of throwing RequestHistoryIndexStaleError.

The test simulates a replaced ledger with { ...revision, ino: revision.ino + 1 }. On NTFS a file id can exceed 2^53, where ino + 1 rounds back to the same double, so the "different" revision compares equal to the real file and the stale check never fires. The test now perturbs dev (the volume serial on Windows, always exactly representable), which drives the same dev/ino identity check in ingestSourceTail on every platform. Test-only; no runtime change. The production comparison (same file vs. its own recorded id) is unaffected because both sides round identically.

Found during release-train verification of #7070.

Verification

  • bun scripts/test.ts tests/usage/request-history-rebuild-worker.test.ts tests/ci-workflows/repo-hygiene.test.ts → 28 pass, 0 fail (macOS)
  • bun run typecheck → exit 0
  • Windows confirmation is left to a workflow_dispatch of Cross-platform CI (PRs run the Ubuntu subset only).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (none needed: test-only)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Updated a stale-index test to cover changes in recorded device and volume values, including a Windows NTFS file-ID precision case.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 14, 2026 02:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T02:44:44.970078Z 469c83b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 756b654f-bc47-4303-b104-ca5134a02438
📥 Commits

Reviewing files that changed from the base of the PR and between 04b7d51 and 469c83b.

📒 Files selected for processing: 1
  • tests/usage/request-history-rebuild-worker.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The stale-ledger test now changes the recorded dev value instead of incrementing ino. Comments describe the Windows NTFS file-ID precision case. The test still expects RequestHistoryIndexStaleError and checks that no SQLite build files remain.

Changes: Stale-ledger test

Layer / File(s) Summary
Stale-ledger test revision
tests/usage/request-history-rebuild-worker.test.ts
The test changes the recorded dev value instead of incrementing ino. Comments describe the Windows NTFS file-ID precision case. The stale-error and no-file assertions remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 469c8

This test-only adjustment still exercises stale-ledger rejection and cleanup. No material merge risk is established; Windows runtime confirmation remains outstanding.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the test change and the Windows precision failure mode caused by incrementing ino.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 469c83b127

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

expect(() => buildIndexFile(buildPath, "test", { ...revision, ino: revision.ino + 1 }))
// Change the volume, not the file id: an NTFS file id can exceed 2^53, where ino + 1 rounds
// back to the same number and the build sees the recorded file (windows CI, #7070).
expect(() => buildIndexFile(buildPath, "test", { ...revision, dev: revision.dev + 1 }))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve coverage of same-volume ledger replacement

When the ledger is atomically replaced on its existing volume, dev remains unchanged and only ino identifies the replacement. This edit therefore stops the deterministic test from exercising the stat.ino !== expected.ino branch in ingestSourceTail; removing or breaking that check would leave this test green while allowing a worker to index a replaced ledger. Keep the inode mismatch but choose a collision-proof value, such as revision.ino === 0 ? 1 : 0, rather than incrementing the potentially imprecise number.

Useful? React with 👍 / 👎.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration into dev (MAINTAINERS.md dev-only exception) for @lidge-jun, release-train blocker (Windows shard 5/9 of run 38499932279). Exact-head verification: required PR checks passed on 469c83b127732a91acc4818f2c2665699e7386e7.

@lidge-jun
lidge-jun merged commit 4a5b0c6 into dev Oct 14, 2026
64 of 66 checks passed
@lidge-jun
lidge-jun deleted the fix/history-rebuild-stale-test-windows-ino branch October 14, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant