Commit 7fb7030
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.
Refs: nodejs/reliability#1450
PR-URL: #61614
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>1 parent 9409d30 commit 7fb7030Copy full SHA for 7fb7030
2 files changed
+24-3Lines changed: 24 additions & 3 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib
- internal/repl
Expand file treeCollapse file tree
Open diff view settings
Collapse file
lib/internal/repl/history.js
Copy file name to clipboardExpand all lines: lib/internal/repl/history.js+16-1Lines changed: 16 additions & 1 deletion
| 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 | |
403 | 410 | |
404 | 411 | |
| 412 | + |
| 413 | + |
| 414 | + |
| 415 | + |
| 416 | + |
| 417 | + |
| 418 | + |
| 419 | + |
405 | 420 | |
406 | 421 | |
407 | 422 | |
|
Collapse file
+8-2Lines changed: 8 additions & 2 deletions
| 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 | + |
1048 | 1054 | |
1049 | 1055 | |
1050 | 1056 | |
|
0 commit comments