From 4709da0372a6bc178afd50f5da16cc9a754977bb Mon Sep 17 00:00:00 2001 From: Jochen Eisinger Date: Thu, 29 Apr 2021 19:53:36 +0200 Subject: [PATCH] test: ensure microtask queues are not automatically drained V8 had a bug that in certain cases the default microtask queue was drained, and this test relies on the behavior. Backport-PR-URL: https://github.com/nodejs/node/pull/39470 PR-URL: https://github.com/nodejs/node/pull/38990 Reviewed-By: Jiawen Geng Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy Reviewed-By: Colin Ihrig --- test/cctest/test_environment.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index cdd4d470fd67d5..f98b22db42ce1a 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -647,7 +647,8 @@ TEST_F(EnvironmentTest, NestedMicrotaskQueue) { const v8::HandleScope handle_scope(isolate_); const Argv argv; - std::unique_ptr queue = v8::MicrotaskQueue::New(isolate_); + std::unique_ptr queue = v8::MicrotaskQueue::New( + isolate_, v8::MicrotasksPolicy::kExplicit); v8::Local context = v8::Context::New( isolate_, nullptr, {}, {}, {}, queue.get()); node::InitializeContext(context);