(pid, timeout)
| 22 | }); |
| 23 | |
| 24 | const processExited = async (pid, timeout) => { |
| 25 | const endTime = Date.now() + timeout; |
| 26 | let interval = PROCESS_EXITED_MIN_INTERVAL; |
| 27 | if (interval > timeout) { |
| 28 | interval = timeout; |
| 29 | } |
| 30 | |
| 31 | let exists; |
| 32 | |
| 33 | do { |
| 34 | await delay(interval); // eslint-disable-line no-await-in-loop |
| 35 | |
| 36 | exists = await processExists(pid); // eslint-disable-line no-await-in-loop |
| 37 | |
| 38 | interval *= 2; |
| 39 | if (interval > PROCESS_EXITED_MAX_INTERVAL) { |
| 40 | interval = PROCESS_EXITED_MAX_INTERVAL; |
| 41 | } |
| 42 | } while (Date.now() < endTime && exists); |
| 43 | |
| 44 | return !exists; |
| 45 | }; |
| 46 | |
| 47 | const preferNotMatching = matches => (a, b) => { |
| 48 | const aMatches = matches(a); |
no test coverage detected