tcmts.cli.budget.test
Shared
- fakePool () => { pool: SlotPool; takes: { onWait: (w: SlotWait) => void; give: () => void; }[]; }
- A pool whose takes wait until `give`n, and look (call their `onWait`) when the test says.
- holding (pid: number, what: string) => SlotHolder
- A holder of a slot, for a SlotWait.
- settlesWithin (p: Promise<unknown>, ms: number) => Promise<boolean>
- Whether `p` settles within `ms`.
Tests
- testASlotWhoseHolderIsGoneIsTakenOver () => Promise<void>
- testAWaitIsSaidOnceAgainOnlyWhenItChangesAndWhenItEnds () => Promise<void>
- testDefaultSlotsFollowCoresAndMemory () => void
- testSlotsAreServedInTurnAndSeveralTogether () => Promise<void>
- testSlotsAreTakenAndGivenBack () => Promise<void>
- testSlotsHeldByAnotherProcessCount () => Promise<void>
- testWaitTimesAreBrief () => void
- testWaitingNamesOtherRunsBriefly () => Promise<void>
- testWorkInASlotTakesNoMore () => Promise<void>
- Work inside a slot takes no more for what it runs: nested work runs at once (so it never waits behind itself), and what it starts as a process is told it's in the slot.
- testWorkWaitsForASlotAndGivesItBack () => Promise<void>
- Work in a slot waits for one, says so, and gives it back when it ends, however it ends.