Repository navigation
test: raise the Vitest hook timeout to 60s - #227
Merged
Merged
Conversation
Three test files each compiled the whole project with tsc in their beforeAll. Running in parallel with the rest of the suite, those hooks took close to Vitest's default 10s hookTimeout and sometimes went over. A timed-out compileCli() never returned its cleanup, so its .cli-test-* build stayed in the repo root, and the next run collected the compiled copies of the tests inside it and failed across the board. - Compile once in a Vitest globalSetup and hand the path to the tests with provide/inject. The build goes under node_modules/.cache, which Vitest never collects from, and is removed when the compile fails. - Raise hookTimeout to 60s in a new vitest.config.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016XtpQtt5LQb3A1b6nkD4DY
JuanGalilea
requested changes
Oct 30, 2026
JuanGalilea
left a comment
Contributor
There was a problem hiding this comment.
tbh do we even need to optimize this? we create 2 or 3 and its performant enough and afaik the number is not going to grow more, no?
Contributor
There was a problem hiding this comment.
dont like this, why not just create it as part of the file import. meaning create the folder on root level and then using it?
just move the main setup thing out of the function and provide a way to tear it down withoult having issues with each other.
Member
Author
There was a problem hiding this comment.
I haven't really looked at the code, I trimmed the PR just to timeout increase which is what was blocking me
Drop the shared globalSetup compile and go back to compiling the CLI in each test file as on master. The 60s hookTimeout alone stops those hooks from timing out when the whole suite runs in parallel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016XtpQtt5LQb3A1b6nkD4DY
metalwarrior665
marked this pull request as ready for review
October 31, 2026 08:29
1 task done
metalwarrior665
added a commit
that referenced
this pull request
Nov 4, 2026
…ed-files (#228) I think this makes sense, users can use `get-affected-actors` to get changedFiles too. ## AI `get-affected-actors` (#204) now computes commits, changed files and changelog in one place from a single diff path. The three older commands (`get-commits`, `get-latest-commit`, `get-changed-files`) are documented as "kept for older workflows", but no workflow in this repo uses them. They still carry a second, parallel git model: - `getCommits`, which has its own rerun and base-commit heuristics and duplicates what `since` does in `get-affected-actors`. - `getChangedFiles`, which is `getChangedFilesBetween` with a `~` hack. - `parseBaseCommit`, with the "SHA or Commit JSON" overload that only existed to pipe `get-latest-commit` output back in. - The `--source-branch`, `--target-branch` and `--base-commit` flags, the `gitRangeOptions` group and the `Config` type. #218 left these out on purpose and said the call belongs to the maintainers. This PR is that proposal. ## What - Remove the three commands and everything only they used. About 140 lines of source and about 250 lines of tests go away. - `resolveReleaseBaseCommit` now validates the SHA inline and reuses `findCommitSha`, instead of a second copy of the "`rev-parse` exit code 1 means missing" handling. - Drop the "Legacy git commands" section from `docs/cli.md`. CONTRIBUTING's CLI example now uses `get-affected-actors --base master`. - Delete `logging.test.ts`. It compiled the whole project with `tsc` (the cause of #227's timeout) just to check log levels through `get-commits`. The same check is now two cases in `cli-bundle.test.ts` that run `get-affected-actors` against the committed bundle. - Rebuild the CLI bundle. ## Breaking Anyone who calls these three commands directly breaks. The `workflows-v0` reusable workflows don't, so only external users scripting the CLI are affected. Since we're before v1, this is the cheapest time to drop them. Whether to do it is the open question for reviewers. ## Other ideas I considered and left out Each overlaps an open PR, so it would conflict: - #218 (build pipeline), #223 (`test` and `notify` commands) and #224 (bundle-based CLI tests) already cover the build and reporting code. - Filling `lib/` gaps from issues (`fails` modifier #159, standby without a task #127) are features, not refactors. ## Checks - [x] `tsc`, eslint, prettier, knip (the unused exports it lists were already on master) and `npm test` pass: 31 files, 438 tests. --- _Generated by [Claude Code](https://claude.ai/code/session_016XtpQvEqmuEhj1cBAaUxML)_ Co-authored-by: Claude <noreply@anthropic.com>
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.
Problem
affected-actors-cli,build-cliandloggingeach compile the whole project withtscin theirbeforeAll. That's about 5s per compile, and the three run at the same time as the rest of the suite. The repo has no Vitest config, so those hooks run under Vitest's default 10shookTimeout, and in the pre-commit hook they sometimes went over it.Change
vitest.config.tssetshookTimeout: 60_000. Unit tests taking longer than 10s is fine; a flaky run isn't.vitest.config.tsis added to ESLint'signores, next toeslint.config.mjs, because it isn't part of the tsconfig project.Checks
npm test: 32 files passed, 1 skippedeslint,prettier --checkandtype-checkpass🤖 Generated with Claude Code
https://claude.ai/code/session_016XtpQtt5LQb3A1b6nkD4DY