Skip to content

Commit a2f440d

Browse files
Trottaddaleax
authored andcommitted
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: #30649 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 3e3ad39 commit a2f440d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/sequential/test-inspector-contexts.js

+8
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ async function testContextCreatedAndDestroyed() {
6565
JSON.stringify(contextCreated));
6666

6767
// GC is unpredictable...
68+
console.log('Checking/waiting for GC.');
6869
while (!contextDestroyed)
6970
global.gc();
71+
console.log('Context destroyed.');
7072

7173
assert.strictEqual(contextDestroyed.params.executionContextId, id,
7274
JSON.stringify(contextDestroyed));
@@ -95,8 +97,10 @@ async function testContextCreatedAndDestroyed() {
9597
JSON.stringify(contextCreated));
9698

9799
// GC is unpredictable...
100+
console.log('Checking/waiting for GC again.');
98101
while (!contextDestroyed)
99102
global.gc();
103+
console.log('Other context destroyed.');
100104
}
101105

102106
{
@@ -119,8 +123,10 @@ async function testContextCreatedAndDestroyed() {
119123
JSON.stringify(contextCreated));
120124

121125
// GC is unpredictable...
126+
console.log('Checking/waiting for GC a third time.');
122127
while (!contextDestroyed)
123128
global.gc();
129+
console.log('Context destroyed once again.');
124130
}
125131

126132
{
@@ -141,8 +147,10 @@ async function testContextCreatedAndDestroyed() {
141147
JSON.stringify(contextCreated));
142148

143149
// GC is unpredictable...
150+
console.log('Checking/waiting for GC a fourth time.');
144151
while (!contextDestroyed)
145152
global.gc();
153+
console.log('Context destroyed a fourth time.');
146154
}
147155
}
148156

0 commit comments

Comments
 (0)