Commit 56947c3
committed
repl: fix flaky test-repl-programmatic-history
The test was flaky because the FileHandle for the history file could be
garbage collected before being explicitly closed, causing ERR_INVALID_STATE
errors when the handle was already closed by the GC finalizer.
This fix adds an explicit closeHandle() method to ReplHistory and ensures
that REPLServer.close() waits for the history file handle to be properly
closed before completing the close operation.
Fixes: nodejs/reliability#14501 parent f6464c5 commit 56947c3
2 files changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
396 | 401 | | |
| 402 | + | |
| 403 | + | |
397 | 404 | | |
398 | | - | |
| 405 | + | |
399 | 406 | | |
400 | 407 | | |
401 | 408 | | |
402 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
403 | 419 | | |
404 | 420 | | |
405 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1039 | 1039 | | |
1040 | 1040 | | |
1041 | 1041 | | |
1042 | | - | |
| 1042 | + | |
1043 | 1043 | | |
1044 | | - | |
| 1044 | + | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1048 | 1056 | | |
1049 | 1057 | | |
1050 | 1058 | | |
| |||
0 commit comments