( config: Config, workspaceId: string, timeoutMs = 20_000 )
| 133 | } |
| 134 | |
| 135 | async function waitForWorkspaceRemoval( |
| 136 | config: Config, |
| 137 | workspaceId: string, |
| 138 | timeoutMs = 20_000 |
| 139 | ): Promise<void> { |
| 140 | const start = Date.now(); |
| 141 | while (findWorkspaceInConfig(config, workspaceId)) { |
| 142 | if (Date.now() - start > timeoutMs) { |
| 143 | throw new Error(`Timed out waiting for workspace cleanup (workspaceId=${workspaceId})`); |
| 144 | } |
| 145 | |
| 146 | // Patch artifact readiness flips before the async cleanup recheck removes the child workspace. |
| 147 | await new Promise((resolve) => setTimeout(resolve, 50)); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | function createNullInitLogger() { |
| 152 | return { |
no test coverage detected