Skip to content

Commit 978bbf9

Browse files
committed
test: fix flaky test-http2-pack-end-stream-flag
Signed-off-by: James M Snell <[email protected]> Fixes: #37639 PR-URL: #37814 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 7d67273 commit 978bbf9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/parallel/test-http2-pack-end-stream-flag.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ server.on('stream', (stream, headers) => {
3232
function testRequest(path, targetFrameCount, callback) {
3333
const obs = new PerformanceObserver(
3434
common.mustCallAtLeast((list, observer) => {
35-
const entry = list.getEntries()[0];
36-
if (entry.name !== 'Http2Session') return;
37-
if (entry.detail.type !== 'client') return;
38-
assert.strictEqual(entry.detail.framesReceived, targetFrameCount);
39-
observer.disconnect();
40-
callback();
35+
const entries = list.getEntries();
36+
for (let n = 0; n < entries.length; n++) {
37+
const entry = entries[n];
38+
if (entry.name !== 'Http2Session') continue;
39+
if (entry.detail.type !== 'client') continue;
40+
assert.strictEqual(entry.detail.framesReceived, targetFrameCount);
41+
observer.disconnect();
42+
callback();
43+
}
4144
}));
4245
obs.observe({ type: 'http2' });
4346
const client =

0 commit comments

Comments
 (0)