summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnatoli Papirovski <apapirovski@mac.com>2018-01-08 21:05:14 -0500
committerJames M Snell <jasnell@gmail.com>2018-01-09 08:25:37 -0800
commitececdd316766998ca3309ccb01f5618d44d0d91e (patch)
treea9bc0820b76d69b99dbb9f91496edd7c7be26c9c /test
parentf3f3f8890c2e2364ca88f043e1ab675d72c370e6 (diff)
downloadandroid-node-v8-ececdd316766998ca3309ccb01f5618d44d0d91e.tar.gz
android-node-v8-ececdd316766998ca3309ccb01f5618d44d0d91e.tar.bz2
android-node-v8-ececdd316766998ca3309ccb01f5618d44d0d91e.zip
perf_hooks: fix scheduling regression
Scheduling a PerformanceGCCallback should not keep the loop alive but due to the recent switch to using the native SetImmediate method, it does. Go back to using uv_async_t and add a regression test. PR-URL: https://github.com/nodejs/node/pull/18051 Fixes: https://github.com/nodejs/node/issues/18047 Refs: https://github.com/nodejs/node/pull/18020 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-performance-gc.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-performance-gc.js b/test/parallel/test-performance-gc.js
index 89a9041c1c..ec0714ea50 100644
--- a/test/parallel/test-performance-gc.js
+++ b/test/parallel/test-performance-gc.js
@@ -51,3 +51,13 @@ const kinds = [
// Keep the event loop alive to witness the GC async callback happen.
setImmediate(() => setImmediate(() => 0));
}
+
+// GC should not keep the event loop alive
+{
+ let didCall = false;
+ process.on('beforeExit', () => {
+ assert(!didCall);
+ didCall = true;
+ global.gc();
+ });
+}