mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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: https://github.com/nodejs/reliability/issues/1450 PR-URL: https://github.com/nodejs/node/pull/61614 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>