repl: fix flaky test-repl-programmatic-history · nodejs/node@7fb7030 · GitHub
Skip to content

Commit 7fb7030

Browse files
mcollinaaduh95
authored andcommitted
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 7fb7030

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

lib/internal/repl/history.js

Lines changed: 16 additions & 1 deletion

lib/repl.js

Lines changed: 8 additions & 2 deletions

0 commit comments

Comments
 (0)