From a25aab1d1d3010a9f14a1efb4ec13214f02eb923 Mon Sep 17 00:00:00 2001 From: Gabriel Bota Date: Tue, 7 May 2024 21:15:38 +0200 Subject: [PATCH] fix flaky test with debug build --- src/handle_wrap.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 69e2a389f9e148..17728380082220 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -148,7 +148,8 @@ void HandleWrap::OnClose(uv_handle_t* handle) { wrap->OnClose(); wrap->handle_wrap_queue_.Remove(); - if (!wrap->persistent().IsEmpty() && + if (!env->isolate()->IsExecutionTerminating() && + !wrap->persistent().IsEmpty() && wrap->object()->Has(env->context(), env->handle_onclose_symbol()) .FromMaybe(false)) { wrap->MakeCallback(env->handle_onclose_symbol(), 0, nullptr);