| 1 | import * as Test from "@/Test/Alchemy"; |
| 2 | import { makeEc2VpcCapacityLease } from "./VpcCapacity.ts"; |
| 3 | |
| 4 | /** Test adapter for files that create custom VPCs. */ |
| 5 | export const make = <ROut = any>( |
| 6 | options: Test.MakeOptions<ROut>, |
| 7 | permits: 1 | 2 = 1, |
| 8 | ) => { |
| 9 | const api = Test.make(options); |
| 10 | const lease = makeEc2VpcCapacityLease(permits); |
| 11 | |
| 12 | // Waiting is intentional scheduling across the full AWS run, not a cloud |
| 13 | // operation, so it uses the run's hard wall rather than a per-test budget. |
| 14 | api.beforeAll(lease.acquire, { timeout: 3_600_000 }); |
| 15 | api.afterAll(lease.release); |
| 16 | |
| 17 | return api; |
| 18 | }; |