(
timeoutMs: number,
options: { readonly port?: number } = {},
)
| 194 | |
| 195 | /** Poll for a reachable supervised daemon until the deadline. */ |
| 196 | const waitForSupervisedAttach = async ( |
| 197 | timeoutMs: number, |
| 198 | options: { readonly port?: number } = {}, |
| 199 | ): Promise<SidecarConnection | null> => { |
| 200 | const deadline = Date.now() + timeoutMs; |
| 201 | for (;;) { |
| 202 | const attached = await attachToSupervisedDaemon(); |
| 203 | if (attached && (options.port === undefined || attached.port === options.port)) return attached; |
| 204 | if (Date.now() >= deadline) return null; |
| 205 | await delay(300); |
| 206 | } |
| 207 | }; |
| 208 | |
| 209 | const confirmEnableBackgroundService = async (): Promise<boolean> => { |
| 210 | // EXECUTOR_TEST_AUTO_CONFIRM_BACKGROUND_SERVICE skips the modal, the same seam |
no test coverage detected