Repository navigation
Stop two order- and seed-dependent test failures: a temp-file mock that ignored holds, and di/pr as random command names - #427
Merged
Conversation
…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.
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 39 minutes. View limit details
|
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 oftemp-file.tsinsend-to-stata-app-temp-file-lifecycle.test.tshad nohold_temp_fileorrelease_temp_fileand deleted the file unconditionally, so whethertemp-file.test.tspassed depended on file order. The mock now honors holds, as the one insend-to-stata-integrated-terminal.test.tsalready does.diandpras random command names (failed on this PR's first run).varlist-parsing-consolidation.prop.test.tsdraws random command names. A two-letter draw is sometimesdi(display's arguments are not a varlist) orpr(a program definition); CI reported counterexamples["di","_",1]and["_","pr","a",1]. The parser reads both the same way at6d98b9b5, 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.tsgives 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 areby di if n no pr; the generator already excluded all butdiandpr. The property file passes six runs in a row. Line endings, typecheck, lint andbun run test:ci(10,192 pass, 0 fail) pass with main merged in.