mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 08:02:32 +00:00
* 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
26 lines
793 B
TypeScript
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)
|
|
}
|
|
)
|