Skip to content

test(asar): verify cleanup on the original file handle - #15155

Merged
vincentkoc merged 1 commit into
morluto:mainfrom
ShuaixinHuang:test/asar-track-owned-file-handles
Nov 30, 2026
Merged

vincentkoc merged 1 commit into
morluto:mainfrom
ShuaixinHuang:test/asar-track-owned-file-handles

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The ASAR cleanup tests save a numeric descriptor and expect fstatSync on that number to throw after the reader closes. The OS can recycle that number before the assertion. In a local Node control, the original FileHandle reported fd === -1, an unrelated file obtained its former number, and fstatSync on the former number succeeded.

The packed-member cancellation case previously failed on this assertion in CI, causing downstream Portable tests to fail. The CI log does not establish which file held the number at the time.

Change and scope

Retain the exact FileHandle returned by the test's injected open function. Verify the open file via that handle and verify closure through its own invalidated descriptor. Keep the assertions for snapshot removal, cancellation and close retry. This changes only the ASAR cleanup tests. No related issue was found in the targeted search.

Verification

The descriptor-reuse control reproduces the old oracle's false positive. Both the ASAR reader cleanup and streaming allocation suites pass on Linux. Normal commit and push checks passed.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T05:24:29.550497Z 4bfa59a 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.

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · This test-only change appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

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

Summary

The tests now check the original FileHandle instead of a descriptor number that the OS can reuse.

  • ASAR cleanup tests check the same file handle before and after closing.

Reviews (1) · Last reviewed commit: "test(asar): verify cleanup on the origin..." · Reviewed by Greptile

@vincentkoc
vincentkoc merged commit 4ccc685 into morluto:main Nov 30, 2026
39 checks passed
@vincentkoc

Copy link
Copy Markdown
Collaborator

Thanks! Squash-merged in 4ccc685 after a clean P2 review and all eight cleanup tests passing. The checks now follow the original handle without weakening cancellation or retry coverage.

vincentkoc added a commit to xu91102/rea that referenced this pull request Nov 30, 2026
* commit '4ccc685dd5ed028bc625fdd8760539ce5a492d8d': (228 commits)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
  test(beam): reuse the CLI Evidence reader (morluto#15171)
  test(oci): share descriptor budget refusal assertions (morluto#15159)
  refactor(audit): share byte framing for offline audit logs (morluto#15162)
  refactor(evidence): reuse observed file reports for binary metadata (morluto#15161)
  fix(doctor): omit package-runner cache shims from installations (morluto#15059)
  refactor(packages): share package inspection budget contracts (morluto#15158)
  refactor(desktop): share completed command answer recovery (morluto#15156)
  refactor(views): share page byte reservations (morluto#15152)
  refactor(artifacts): share GPU and media asset layout rules (morluto#15150)
  fix(setup): name the detected host when Hopper setup does not apply (morluto#14449)
  fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020)
  fix(windows): report the ACE count a private DACL check observed (morluto#14450)
  fix(artifacts): read Ogg Opus channel mapping tables (morluto#14975)
  ...
vincentkoc added a commit to liziye627-design/rea that referenced this pull request Nov 30, 2026
* commit 'e18ed55bac14191010efe91ba61489cab1d2ba55': (137 commits)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
  test(beam): reuse the CLI Evidence reader (morluto#15171)
  test(oci): share descriptor budget refusal assertions (morluto#15159)
  refactor(audit): share byte framing for offline audit logs (morluto#15162)
  refactor(evidence): reuse observed file reports for binary metadata (morluto#15161)
  fix(doctor): omit package-runner cache shims from installations (morluto#15059)
  refactor(packages): share package inspection budget contracts (morluto#15158)
  refactor(desktop): share completed command answer recovery (morluto#15156)
  refactor(views): share page byte reservations (morluto#15152)
  refactor(artifacts): share GPU and media asset layout rules (morluto#15150)
  fix(setup): name the detected host when Hopper setup does not apply (morluto#14449)
  fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020)
  fix(windows): report the ACE count a private DACL check observed (morluto#14450)
  ...
vincentkoc added a commit to viniciusdsandrade/rea that referenced this pull request Nov 30, 2026
* commit '76cb6645be39cf3844f7a8bb4568b02d8a713595': (95 commits)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
  test(beam): reuse the CLI Evidence reader (morluto#15171)
  test(oci): share descriptor budget refusal assertions (morluto#15159)
  refactor(audit): share byte framing for offline audit logs (morluto#15162)
  refactor(evidence): reuse observed file reports for binary metadata (morluto#15161)
  fix(doctor): omit package-runner cache shims from installations (morluto#15059)
  refactor(packages): share package inspection budget contracts (morluto#15158)
  refactor(desktop): share completed command answer recovery (morluto#15156)
  refactor(views): share page byte reservations (morluto#15152)
  refactor(artifacts): share GPU and media asset layout rules (morluto#15150)
  fix(setup): name the detected host when Hopper setup does not apply (morluto#14449)
  fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020)
  ...
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit '6c7dffc59b970fcfae023af3171d92ee0ac50f94': (137 commits)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
  test(beam): reuse the CLI Evidence reader (morluto#15171)
  test(oci): share descriptor budget refusal assertions (morluto#15159)
  refactor(audit): share byte framing for offline audit logs (morluto#15162)
  refactor(evidence): reuse observed file reports for binary metadata (morluto#15161)
  fix(doctor): omit package-runner cache shims from installations (morluto#15059)
  refactor(packages): share package inspection budget contracts (morluto#15158)
  refactor(desktop): share completed command answer recovery (morluto#15156)
  refactor(views): share page byte reservations (morluto#15152)
  refactor(artifacts): share GPU and media asset layout rules (morluto#15150)
  fix(setup): name the detected host when Hopper setup does not apply (morluto#14449)
  ...
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit '6c7dffc59b970fcfae023af3171d92ee0ac50f94':
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit '91380cff6a6ce8b82b042ceb4e5013f3cc87a9d0':
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
vincentkoc added a commit to ShuaixinHuang/rea that referenced this pull request Nov 30, 2026
* commit '91380cff6a6ce8b82b042ceb4e5013f3cc87a9d0':
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
vincentkoc added a commit to sandivd/rea that referenced this pull request Nov 30, 2026
* commit '5c3c1edd72453746266691deca2c7355a8df9b0d': (623 commits)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  fix(ubi): bound smaller-grid probe memoization (morluto#15168)
  fix(artifacts): distinguish content from containment changes (morluto#15165)
  fix(bflt): retain complete text when data is truncated (morluto#15160)
  refactor(domain): reuse graph projection and validation helpers (morluto#15173)
  fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801)
  test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172)
  test(beam): reuse the CLI Evidence reader (morluto#15171)
  ...

# Conflicts:
#	src/cli/cliCommandRegistrations.ts
vincentkoc added a commit to DeryFerd/rea that referenced this pull request Nov 30, 2026
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits)
  fix(android): declare Android mapping and JNI fixed allowances (morluto#15183)
  fix(artifacts): retain deep comparison source chains (morluto#15191)
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  ...
vincentkoc added a commit to DeryFerd/rea that referenced this pull request Nov 30, 2026
* commit '31cec30f51fb59b28a1849a67d09ab79b1c40094': (803 commits)
  fix(android): declare Android mapping and JNI fixed allowances (morluto#15183)
  fix(artifacts): retain deep comparison source chains (morluto#15191)
  perf(evidence): bound link inspection frontier by records (morluto#15189)
  perf(evidence): retain snapshots across duplicate imports (morluto#15186)
  fix(nro): exclude ASET header bytes from asset ranges (morluto#15185)
  fix(bflt): reject relocation tables overlapping image segments (morluto#15188)
  docs(artifacts): document Kubernetes audit log inventory (morluto#15187)
  fix(dtbo): keep coverage unknown beyond the declared image (morluto#15182)
  perf(n64): stream ROM byte-order normalization (morluto#15179)
  fix(oci)!: keep unobserved directory identity unknown (morluto#15164)
  fix(nds): bind file names to disjoint FNT subtables (morluto#15178)
  fix(glb): preserve JSON chunk read failures (morluto#15181)
  fix(ci): run npm lifecycle hooks in selected host lanes (morluto#15169)
  fix(artifacts): retain stored files in Godot PCK patches (morluto#15180)
  fix(setup): do not persist versioned launcher paths (morluto#15123)
  fix(devicetree): read later FDT versions backwards compatible with v17 (morluto#14136)
  fix(json): classify JSON input heap headroom and string-ceiling refusals (morluto#14949)
  fix(macos-pkg): retain cpio hard-link contents (morluto#15157)
  fix(artifacts): report macOS package bundle release versions (morluto#14860)
  test(asar): verify cleanup on the original file handle (morluto#15155)
  ...
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.

2 participants