Commit ee5bfbb
Address PR review: fix test to exercise actual race condition, improve comments
- Rewrite buildVM recovery test to trigger synchronous throw (via
vm.createContext mock) before the first await, which is the actual
bug scenario. The old test used a nonexistent file path which fails
asynchronously at readFileAsync — already handled by the old code.
- Fix test to retry the SAME path after failure, proving the
vmCreationPromises map was properly cleaned up.
- Fix inaccurate comment example in vm.ts (readFileAsync → vm.createContext)
- Replace stale line number reference with semantic reference
- Add vmCreationPromises.delete() to removeVM to prevent stale entries
Co-Authored-By: Claude Opus 4.6 <[email protected]>1 parent fef7fba commit ee5bfbb
2 files changed
Lines changed: 29 additions & 12 deletions
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
368 | 369 | | |
369 | 370 | | |
370 | 371 | | |
| |||
386 | 387 | | |
387 | 388 | | |
388 | 389 | | |
| 390 | + | |
389 | 391 | | |
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
542 | 543 | | |
543 | 544 | | |
544 | 545 | | |
545 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
546 | 550 | | |
547 | 551 | | |
548 | 552 | | |
549 | 553 | | |
550 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
551 | 566 | | |
552 | | - | |
553 | | - | |
| 567 | + | |
| 568 | + | |
554 | 569 | | |
555 | | - | |
556 | | - | |
| 570 | + | |
| 571 | + | |
557 | 572 | | |
558 | 573 | | |
559 | 574 | | |
| |||
0 commit comments