Skip to content

Commit

Permalink
test: add logging in case of infinite loop
Browse files Browse the repository at this point in the history
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: #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>
  • Loading branch information
Trott authored and targos committed Dec 1, 2019
1 parent 95dd550 commit d191acc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/sequential/test-inspector-contexts.js
Expand Up @@ -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));
Expand Down Expand Up @@ -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.');
}

{
Expand All @@ -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.');
}

{
Expand All @@ -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.');
}
}

Expand Down

0 comments on commit d191acc

Please sign in to comment.