Skip to content

Commit

Permalink
test: fix flaky test-http2-pack-end-stream-flag
Browse files Browse the repository at this point in the history
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #37639

PR-URL: #37814
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
jasnell committed Mar 22, 2021
1 parent 7d67273 commit 978bbf9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/parallel/test-http2-pack-end-stream-flag.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ server.on('stream', (stream, headers) => {
function testRequest(path, targetFrameCount, callback) {
const obs = new PerformanceObserver(
common.mustCallAtLeast((list, observer) => {
const entry = list.getEntries()[0];
if (entry.name !== 'Http2Session') return;
if (entry.detail.type !== 'client') return;
assert.strictEqual(entry.detail.framesReceived, targetFrameCount);
observer.disconnect();
callback();
const entries = list.getEntries();
for (let n = 0; n < entries.length; n++) {
const entry = entries[n];
if (entry.name !== 'Http2Session') continue;
if (entry.detail.type !== 'client') continue;
assert.strictEqual(entry.detail.framesReceived, targetFrameCount);
observer.disconnect();
callback();
}
}));
obs.observe({ type: 'http2' });
const client =
Expand Down

0 comments on commit 978bbf9

Please sign in to comment.