(cp: ChildProcess)
| 542 | }; |
| 543 | |
| 544 | export const stopAgent = async (cp: ChildProcess) => { |
| 545 | // The command `kill` is used to terminate an agent started as a standalone binary. |
| 546 | exec(`kill ${cp.pid}`, (error) => { |
| 547 | if (error) { |
| 548 | throw new Error(`exec error: ${JSON.stringify(error)}`); |
| 549 | } |
| 550 | }); |
| 551 | await waitUntilUrlIsNotResponding(`http://localhost:${prometheusPort}`); |
| 552 | }; |
| 553 | |
| 554 | export const waitUntilUrlIsNotResponding = async (url: string) => { |
| 555 | const maxRetries = 30; |
no test coverage detected