Skip to content

test(host-kit): stub os.homedir for the exec-trace late-close test - #3898

Merged
thymikee merged 2 commits into
mainfrom
fix/exec-trace-test-under-stryker
Oct 22, 2026
Merged

thymikee merged 2 commits into
mainfrom
fix/exec-trace-test-under-stryker

Conversation

@thymikee

@thymikee thymikee commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

The advisory Mutation Harness Canary (kernel-errors) has failed since #3846 added the "environment-only late close" exec-trace test. Stryker's vitest runner forces the thread pool, where vi.stubEnv('HOME') only changes the worker's copy of process.env. os.homedir() reads the real process HOME, so the diagnostics homedir fallback wrote outside the temp home and the test read undefined.

The test now redirects os.homedir() with vi.spyOn, as replay-port/source-discovery.test.ts does. Production code and the assertions are unchanged: the late close must still append to the finalized record with no second file. 1 file touched (test only). No linked issue.

Validation

🤖 Generated with Claude Code

vi.stubEnv('HOME') does not reach os.homedir() in worker threads, which is
the pool Stryker's vitest runner forces. The diagnostics homedir fallback
then wrote outside the temp home and the test read an undefined path,
failing the Mutation Harness Canary dry run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.53 MB 5.53 MB 0 B
Package (unpacked) 5.53 MB 5.53 MB 0 B
Package (download) 1.68 MB 1.68 MB -8 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 33.1 ms 35.2 ms +2.1 ms
CLI --help 65.0 ms 64.5 ms -0.5 ms

@thymikee

Copy link
Copy Markdown
Member Author

I found no problems in 495cd8d. The test change in exec-trace.test.ts looks correct and stays within that one file.

The failing check is the snapshot-route.test.ts cap (#3890). Your diff does not touch that route, so it looks unrelated. It needs to clear on main before this PR can merge. There are no conflicts.

I did not run the test with HOME unset. I also did not confirm that os.homedir() ignores a stubbed HOME in worker threads. That claim comes from the oxlint comment.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 22, 2026
@thymikee
thymikee merged commit e3ed027 into main Oct 22, 2026
16 checks passed
@thymikee
thymikee deleted the fix/exec-trace-test-under-stryker branch October 22, 2026 08:15
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-22 08:20 UTC

thymikee added a commit that referenced this pull request Oct 22, 2026
Brings in #3892, which fixes the iOS simulator logs stop hang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* origin/main:
  perf(ios): read each resolved text input through one snapshot (#3882)
  fix(gate): take the host validation lock for heavy gates (#3900)
  fix(logs): keep an early iOS simulator logs stop from hanging the session (#3892)
  fix(apple): clean the runner derived path the runner uses (#3897)
  test(provider-scenarios): open deadline scenarios without the test IME (#3903)
  test(host-kit): stub os.homedir for the exec-trace late-close test (#3898)
thymikee added a commit that referenced this pull request Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ps/ios-suite:
  fix(perf): stop the log stream right after it starts
  perf(ios): read each resolved text input through one snapshot (#3882)
  fix(gate): take the host validation lock for heavy gates (#3900)
  fix(logs): keep an early iOS simulator logs stop from hanging the session (#3892)
  fix(apple): clean the runner derived path the runner uses (#3897)
  test(provider-scenarios): open deadline scenarios without the test IME (#3903)
  test(host-kit): stub os.homedir for the exec-trace late-close test (#3898)
thymikee added a commit that referenced this pull request Oct 22, 2026
* origin/main:
  perf(ios): confirm fill focus from the tapped input before the keyboard (#3906)
  feat(perf): time every iOS command against the fixture app (#3885)
  fix(ios): stop the XCTest-channel penalty from re-arming itself (#3896)
  test(android): pin that a child vanishing mid-read reads as gone (#3905)
  ci: skip device smoke lanes when a PR changes no lane input (#3904)
  fix(ios): verify deep-tree back on the sole screen (#3894)
  fix(ios): synthesize long presses and the gesture viewport on deep trees (#3893)
  perf(ios): read each resolved text input through one snapshot (#3882)
  fix(gate): take the host validation lock for heavy gates (#3900)
  fix(logs): keep an early iOS simulator logs stop from hanging the session (#3892)
  fix(apple): clean the runner derived path the runner uses (#3897)
  test(provider-scenarios): open deadline scenarios without the test IME (#3903)
  test(host-kit): stub os.homedir for the exec-trace late-close test (#3898)
  feat(test-app): add a Bluesky-depth heavy feed screen (#3884)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant