Skip to content

Commit 04be48b

Browse files
committed
Serialize Deno check tasks behind install in mise test
Running `mise run test` was intermittently failing in the install step with `NotFound: Unable to get CWD` while loading the yaml CJS package as part of `@fedify/vocab` codegen. Reproduction with `(deno lint &); deno task install` showed the race is triggered whenever another Deno process starts concurrently with the codegen process. Failure rates measured across stable releases: - Deno 2.6.10: 2/10 - Deno 2.7.7: 3/10 - Deno 2.7.13: 3–5/10 - Deno 2.7.14: 4/10 So neither upgrading nor downgrading Deno avoids it. The root cause is the well-known race in Deno's `nodeModulesDir: "auto"`. When multiple Deno processes start at once they each try to manage `node_modules/.deno/` and the `node_modules/@fedify/*` workspace symlinks (verified with `strace`: deno lint unlinks and recreates these symlinks at startup, and the `.deno.lock.poll` file is also rewritten). Under that race, the CJS loader for `yaml@2.8.3` can hit a state where `Deno.cwd()` returns NotFound from inside `Module._nodeModulePaths`, killing the codegen subprocess. See the related upstream report: denoland/deno#33311 Add `wait_for = ["install"]` to the Deno-based `check:*` tasks (`check:fmt`, `check:lint`, `check:types`, `check-versions`, `check:fixture-usage`). `wait_for` is mise's optional dependency: when `install` is already in the queue (as it is via `prepare` from `test:deno`/`test:node`/`test:bun`), the check tasks wait for it to complete before starting their own Deno processes; when `install` is not queued (e.g. running `mise run check` on its own), the tasks proceed immediately. Empty Deno runs left alone (`check:md`, `check:manifest:workspace-protocol`) are unaffected. With this change the previously flaky reproducer succeeded 10/10 times under the same parallel load. Assisted-by: Claude Code:claude-opus-4-7
1 parent 880d1e5 commit 04be48b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@ depends = [
5252

5353
[tasks."check:fmt"]
5454
description = "Check code formatting"
55+
wait_for = ["install"]
5556
run = "deno fmt --check"
5657

5758
[tasks."check:lint"]
5859
description = "Check code linting"
60+
wait_for = ["install"]
5961
run = "deno lint"
6062

6163
[tasks."check:types"]
6264
description = "Check TypeScript types"
65+
wait_for = ["install"]
6366
run = "deno check $(deno eval 'import m from \"./deno.json\" with { type: \"json\" }; for (let p of m.workspace) console.log(p)')"
6467

6568
[tasks."check:md"]
@@ -69,6 +72,7 @@ run = "hongdown --check"
6972
[tasks.check-versions]
7073
description = "Check that all package versions are consistent across the monorepo"
7174
usage = 'flag "--fix" help="Automatically fix version mismatches"'
75+
wait_for = ["install"]
7276
run = '''
7377
if [ "${usage_fix}" = "true" ]; then
7478
deno run --allow-read --allow-write scripts/check_versions.ts --fix
@@ -79,6 +83,7 @@ fi
7983

8084
[tasks."check:fixture-usage"]
8185
description = "Ensure @fedify/fixture is only used in **/*.test.ts files"
86+
wait_for = ["install"]
8287
run = "deno run --allow-read scripts/check_fixture_usage.ts"
8388

8489
[tasks."check:manifest:workspace-protocol"]

0 commit comments

Comments
 (0)