Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"db": "bun drizzle-kit",
"migration": "bun run script/migration.ts",
"fix-node-pty": "bun run script/fix-node-pty.ts",
"test": "bun test --only-failures",
"test": "bun test --timeout 15000 --only-failures",
"typecheck": "tsgo --noEmit"
},
"exports": {
Expand Down
6 changes: 5 additions & 1 deletion packages/core/test/fixture/git.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from "bun:test"
import { describe, expect, setDefaultTimeout, test } from "bun:test"
import { $ } from "bun"
import fs from "fs/promises"
import path from "path"
Expand All @@ -9,6 +9,10 @@ import { tmpdir } from "./tmpdir"

const it = testEffect(Layer.empty)

// These tests each stand up a full git remote fixture; a loaded Windows runner
// can spend 9s+ on that setup alone, so the suite budget matches test/git.test.ts.
setDefaultTimeout(45_000)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: 45s may still be under budget for the spawn-heavy sibling test

The 45s figure is derived from one observed fixture setup (9.3s) plus single git spawns of 2-9s. The sibling test Git > fetches, checks out, and resets remote changes in test/git.test.ts runs about a dozen git operations (setup, clone, commit, fetch, reset, branch, fetch-branch, checkout, reset), so the worst case implied by those same numbers on a loaded runner lands well past 45s and the flake class this PR targets would survive the fix. Re-derive the budget from the worst-case total rather than the per-spawn figure, and keep a per-test override for that one test if 45s cannot cover it.


// A git process that stays alive until something cancels it. It stands in for
// the `git push -u origin main` that was still running when the Windows test
// budget expired in #278.
Expand Down
13 changes: 2 additions & 11 deletions packages/core/test/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { testEffect } from "./lib/effect"

const it = testEffect(LayerNode.compile(Git.node))

// Real Git clone/push against a local origin; Windows runners intermittently exceed the 5s default (#278).
setDefaultTimeout(30_000)
// Real Git clone/push against a local origin; Windows runners intermittently exceed the 5s default (#278), and a loaded runner can spend 9s+ on fixture setup alone with single git spawns at 2-9s, so the suite gets 45s.
setDefaultTimeout(45_000)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Suite default raised to 45s, but the worktree test still pins 30s

setDefaultTimeout(45_000) raises the file-wide default, but the Git worktrees block still passes an explicit 30_000 to it.live (line 119). That test now runs with a smaller budget than the default it was raised to match, and it is the spawn-heaviest test in the file (git init + 4x git config + git commit + worktree add/list/remove), which is exactly the 2-9s-per-spawn Windows case this PR budgets for, so it stays the most likely test to fail at its bound. Raise it to 45_000, or drop the explicit timeout so it inherits the suite default.


describe("Git", () => {
it.live(
Expand All @@ -35,11 +35,6 @@ describe("Git", () => {
expect(yield* read(path.join(target, "README.md"))).toBe("one\n")
}),
),
// Windows CI spends seconds spawning git for the fixture, remote, and
// clone; this test had no explicit budget, so it inherited Bun's 5s
// default and failed there. Same assertion, more generous budget — the
// sibling test below already does this.
15_000,
)

it.live(
Expand All @@ -64,10 +59,6 @@ describe("Git", () => {
expect(yield* read(path.join(target, "README.md"))).toBe("feature\n")
}),
),
// A fresh clone plus remote fetch/reset can exceed Bun's 5s default on
// Windows CI. Give the test a more generous budget without changing what
// it asserts.
15_000,
)
})

Expand Down