Files
orca/src/shared/git-admission-node-compatibility.test.ts
T
Neil 328caa2160 fix(git): reduce queries and preserve data across execution hosts (#24602)
* fix(git): reduce queries and preserve data across execution hosts

* fix(ci): exercise pinned Git and serialize mobile dependency entrypoints

* fix(relay): preserve fresh diff retries after hung shared reads

* test(git): wait for fetch barrier before canceling preparation

* fix(i18n): describe index-preserving discard in every locale

* fix(git): retain clone diagnostics and allow WSL policy startup

* test(git): refresh default-base and branch-safety fixtures
2026-10-02 18:05:37 -07:00

26 lines
793 B
TypeScript

import { afterEach, expect, it, vi } from 'vitest'
afterEach(() => {
vi.doUnmock('node:os')
vi.resetModules()
})
it.each([
[undefined, 2],
[() => 6, 2],
[() => 32, 4]
] as const)(
'loads the scheduler with parallelism API %s and capacity %i',
async (api, capacity) => {
vi.resetModules()
vi.doMock('node:os', () => ({ availableParallelism: api }))
const { GENERAL_CAP, GitAdmissionScheduler } = await import('./git-admission-scheduler.js')
expect(GENERAL_CAP).toBe(capacity)
const scheduler = new GitAdmissionScheduler()
const grant = await scheduler.acquire({ args: ['status'], cwd: '/repo' })
expect(scheduler.snapshot().budgets.general.baseUsed).toBe(1)
grant.release()
expect(scheduler.snapshot().budgets.general.baseUsed).toBe(0)
}
)