(
timeoutMs: number,
options: { readonly port?: number } = {},
)
| 227 | |
| 228 | /** Poll for a reachable supervised daemon until the deadline. */ |
| 229 | const waitForSupervisedAttach = async ( |
| 230 | timeoutMs: number, |
| 231 | options: { readonly port?: number } = {}, |
| 232 | ): Promise<SidecarConnection | null> => { |
| 233 | const deadline = Date.now() + timeoutMs; |
| 234 | for (;;) { |
| 235 | const attached = await attachToSupervisedDaemon(); |
| 236 | if (attached && (options.port === undefined || attached.port === options.port)) return attached; |
| 237 | if (Date.now() >= deadline) return null; |
| 238 | await delay(300); |
| 239 | } |
| 240 | }; |
| 241 | |
| 242 | const confirmEnableBackgroundService = async (): Promise<boolean> => { |
| 243 | // EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE skips the modal, the same seam |
no test coverage detected