mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: fix flaky test-http2-pack-end-stream-flag
Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: https://github.com/nodejs/node/issues/37639 PR-URL: https://github.com/nodejs/node/pull/37814 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 file changed
+9
-6
@@ -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 =
|
||||
|
||||
Reference in new issue
Block a user