test: remove two load-dependent CI flakes (#34613)

- git-binary-compatibility: give the docker image runs of the ref-pairing case
  a 90 s budget; each Git call is a docker exec and the case normally takes
  22-25 s of the 30 s default.
- claude-transcript-catch-up: fire the 5 ms catch-up deadline with fake timers
  only after the fallback lookup has started, instead of racing a real timer.
This commit is contained in:
Neil
2026-10-27 16:38:25 -07:00
committed by GitHub
parent 47018d4844
commit acec0e7aa0
2 changed files with 19 additions and 3 deletions
@@ -407,10 +407,23 @@ describe('Claude chat catch-up', () => {
const c = await chat('-old-work', '/new-work')
await c.write([...chatTurn, ...outsideTurn])
const lookup = Promise.withResolvers<string | null>()
const lookupStarted = Promise.withResolvers<void>()
const resolve = vi
.spyOn(sessionFileResolver, 'resolveSessionFilePath')
.mockReturnValueOnce(lookup.promise)
expect(await c.open('a1', { timeoutMs: 5 })).toBe(false)
.mockImplementationOnce(() => {
lookupStarted.resolve()
return lookup.promise
})
// Fire the deadline only once the lookup is in flight; a real 5 ms timer raced slow runners.
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'Date'] })
try {
const opened = c.open('a1', { timeoutMs: 5 })
await lookupStarted.promise
vi.advanceTimersByTime(5)
expect(await opened).toBe(false)
} finally {
vi.useRealTimers()
}
expect(resolve.mock.calls[0]?.[3]?.aborted).toBe(true)
lookup.resolve(null)
await new Promise<void>((done) => setImmediate(done))
+4 -1
View File
@@ -50,6 +50,8 @@ const image = process.env.ORCA_GIT_COMPAT_IMAGE
const binary = process.env.ORCA_GIT_COMPAT_BINARY
const expectedVersion = process.env.ORCA_GIT_COMPAT_VERSION
const describeBinaryCompatibility = image || binary ? describe : describe.skip
const PAIRS_REFS_TEST =
'pairs published, tracked and default refs with configured repositories, on the selected Git binary'
type GitResult = { stdout: string; stderr: string }
@@ -112,7 +114,8 @@ describeBinaryCompatibility('real Git binary compatibility', () => {
}
})
it('pairs published, tracked and default refs with configured repositories, on the selected Git binary', async () => {
// Each Git call is a docker exec: image runs take 22-25 s of a 30 s default, so loaded runners tripped it.
it(PAIRS_REFS_TEST, { timeout: image ? 90_000 : undefined }, async () => {
const root = join(repoPath, 'copy-url')
await mkdir(root)
const cwd = image ? '/repo/copy-url' : root