summaryrefslogtreecommitdiff
path: root/test/sequential/test-inspector-contexts.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-11-25 23:02:24 -0800
committerRich Trott <rtrott@gmail.com>2019-11-27 22:39:51 -0800
commit15146e6f3743e3df5cff8fd04677fe38efc91c94 (patch)
tree1c183ef67363d7902798afe0c1d66bdf5aff5883 /test/sequential/test-inspector-contexts.js
parent9cefd619d8ea9579c83705de2f84a6f6c4c67152 (diff)
downloadnode-new-15146e6f3743e3df5cff8fd04677fe38efc91c94.tar.gz
test: add logging in case of infinite loop
test-inspector-contexts may be entering an infinite loop (or very long-running loop) in CI, resulting in flakiness. Or maybe not. Add logging to find out. PR-URL: https://github.com/nodejs/node/pull/30649 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/sequential/test-inspector-contexts.js')
-rw-r--r--test/sequential/test-inspector-contexts.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/sequential/test-inspector-contexts.js b/test/sequential/test-inspector-contexts.js
index f27f95da99..0918d22e90 100644
--- a/test/sequential/test-inspector-contexts.js
+++ b/test/sequential/test-inspector-contexts.js
@@ -65,8 +65,10 @@ async function testContextCreatedAndDestroyed() {
JSON.stringify(contextCreated));
// GC is unpredictable...
+ console.log('Checking/waiting for GC.');
while (!contextDestroyed)
global.gc();
+ console.log('Context destroyed.');
assert.strictEqual(contextDestroyed.params.executionContextId, id,
JSON.stringify(contextDestroyed));
@@ -95,8 +97,10 @@ async function testContextCreatedAndDestroyed() {
JSON.stringify(contextCreated));
// GC is unpredictable...
+ console.log('Checking/waiting for GC again.');
while (!contextDestroyed)
global.gc();
+ console.log('Other context destroyed.');
}
{
@@ -119,8 +123,10 @@ async function testContextCreatedAndDestroyed() {
JSON.stringify(contextCreated));
// GC is unpredictable...
+ console.log('Checking/waiting for GC a third time.');
while (!contextDestroyed)
global.gc();
+ console.log('Context destroyed once again.');
}
{
@@ -141,8 +147,10 @@ async function testContextCreatedAndDestroyed() {
JSON.stringify(contextCreated));
// GC is unpredictable...
+ console.log('Checking/waiting for GC a fourth time.');
while (!contextDestroyed)
global.gc();
+ console.log('Context destroyed a fourth time.');
}
}