( proc: KernelProcess, timeoutMs: number, )
| 311 | }); |
| 312 | |
| 313 | const waitForProcess = ( |
| 314 | proc: KernelProcess, |
| 315 | timeoutMs: number, |
| 316 | ): Effect.Effect<ProcessOutcome, SecureExecExecutionError> => |
| 317 | use("process.wait", proc, (p) => p.wait()).pipe( |
| 318 | Effect.map( |
| 319 | (exitCode): ProcessOutcome => ({ |
| 320 | _tag: "Exited", |
| 321 | exitCode, |
| 322 | }), |
| 323 | ), |
| 324 | Effect.timeoutOrElse({ |
| 325 | duration: Duration.millis(timeoutMs), |
| 326 | orElse: () => |
| 327 | Effect.sync((): ProcessOutcome => { |
| 328 | proc.kill(9); |
| 329 | return { _tag: "TimedOut" }; |
| 330 | }), |
| 331 | }), |
| 332 | ); |
| 333 | |
| 334 | const runEntryProcess = ( |
| 335 | kernel: SecureExecKernel, |
no test coverage detected