Skip to content

Stop two order- and seed-dependent test failures: a temp-file mock that ignored holds, and di/pr as random command names - #427

Merged
jbearak merged 3 commits into
mainfrom
t3/fix-temp-file-mock-holds
Nov 19, 2026
Merged

jbearak merged 3 commits into
mainfrom
t3/fix-temp-file-mock-holds

Conversation

@jbearak

@jbearak jbearak commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Two tests failed in CI for reasons unrelated to the PRs they ran on.

Held temp file deleted (failed on #424). Bun keeps a mock.module() for later test files. The mock of temp-file.ts in send-to-stata-app-temp-file-lifecycle.test.ts had no hold_temp_file or release_temp_file and deleted the file unconditionally, so whether temp-file.test.ts passed depended on file order. The mock now honors holds, as the one in send-to-stata-integrated-terminal.test.ts already does.

di and pr as random command names (failed on this PR's first run). varlist-parsing-consolidation.prop.test.ts draws random command names. A two-letter draw is sometimes di (display's arguments are not a varlist) or pr (a program definition); CI reported counterexamples ["di","_",1] and ["_","pr","a",1]. The parser reads both the same way at 6d98b9b5, so this was already flaky. The test now draws only names the parser reads as an ordinary command.

Proof: on main, bun test tests/integration/send-to-stata-app-temp-file-lifecycle.test.ts tests/unit/send-to-stata/temp-file.test.ts gives 0 pass, 3 fail, 1 error; with this change 4 pass, 0 fail. Of all one- and two-letter names, the ones not read as ordinary commands are by di if n no pr; the generator already excluded all but di and pr. The property file passes six runs in a row. Line endings, typecheck, lint and bun run test:ci (10,192 pass, 0 fail) pass with main merged in.

…elete a held file

Bun keeps a module mock for later test files. This file's mock of
temp-file.ts had no hold_temp_file/release_temp_file and deleted
unconditionally, so when it ran before temp-file.test.ts (or without
the integrated-terminal test loading first) the held-file test failed
with ENOENT, as it did in CI on #424.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 87 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 09b4ad7d-d183-49d4-b8ee-2006a7fb0636
Commits

Reviewing files that changed from the base of the PR and between 21b95b3 and acc8d76.

Files selected for processing: 2

  • tests/integration/send-to-stata-app-temp-file-lifecycle.test.ts
  • tests/property/varlist-parsing-consolidation.prop.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…rty test's command names

A random two-letter name is sometimes di (display's arguments are not
a varlist) or pr (a program definition), which failed CI on this PR
with counterexamples ["di","_",1] and ["_","pr","a",1]. The
parser reads both the same way at 6d98b9b, so the test was already
flaky.
@jbearak jbearak changed the title Make the app temp-file test's mock honor holds, so test order can't delete a held file Stop two order- and seed-dependent test failures: a temp-file mock that ignored holds, and di/pr as random command names Nov 19, 2026
@jbearak
jbearak merged commit 93d8ec8 into main Nov 19, 2026
14 checks passed
@jbearak
jbearak deleted the t3/fix-temp-file-mock-holds branch November 19, 2026 16:11
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