Commit 5405fe4
authored
fix(cli-repl): account for possibility of
When running under `nyc` for coverage generation, the process's
`process.exit()` internals get monkey-patched to give `nyc` the opportunity
to write coverage data as part of that operation. However, for processes
running under changed working directories, `nyc` may try to write to an incorrect
directory, making the `fs.writeFile()` call fail with an exception,
and so `process.exit()` may not actually stop the process.
This commit adds a `process.abort()` call to make that accounts for this situation,
as well as improved debugging for it.process.exit() throwing under coverage MONGOSH-1943 (#2298)1 parent 1bbd86c commit 5405fe4
1 file changed
+23
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
237 | | - | |
| 235 | + | |
238 | 236 | | |
239 | 237 | | |
240 | 238 | | |
| |||
341 | 339 | | |
342 | 340 | | |
343 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
0 commit comments