-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
investigate flaky test-http2-pack-end-stream-flag #37639
Comments
https://ci.nodejs.org/job/node-test-commit-freebsd/38594/nodes=freebsd11-x64/console
|
https://ci.nodejs.org/job/node-test-commit-osx/39441/nodes=osx1014/console
|
I'm able to replicate the problam on macOS without even running stuff in parallel.
|
Bisecting points to f3eb224 as the change where this issue starts to manifest itself. |
Still happening on CI with some frequency: https://ci.nodejs.org/job/node-test-commit-osx/39504/nodes=osx1014/console
|
I'll take a look a bit later today |
If it helps, I debugged by adding 'use strict';
console.error('starting');
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const http2 = require('http2');
const { PerformanceObserver } = require('perf_hooks');
const server = http2.createServer();
server.on('stream', (stream, headers) => {
stream.respond({
'content-type': 'text/html',
':status': 200
});
switch (headers[':path']) {
case '/singleEnd':
stream.end('OK');
break;
case '/sequentialEnd':
stream.write('OK');
stream.end();
break;
case '/delayedEnd':
stream.write('OK', () => stream.end());
break;
}
});
function testRequest(path, targetFrameCount, callback) {
console.error('test request');
const obs = new PerformanceObserver(
common.mustCallAtLeast((list, observer) => {
console.error('mustcallatleast');
const entry = list.getEntries()[0];
console.error(entry.name, entry.detail.type);
if (entry.name !== 'Http2Session') return;
if (entry.detail.type !== 'client') return;
assert.strictEqual(entry.detail.framesReceived, targetFrameCount);
observer.disconnect();
callback();
}));
obs.observe({ type: 'http2' });
const client =
http2.connect(`http://localhost:${server.address().port}`, () => {
const req = client.request({ ':path': path });
req.resume();
req.end();
req.on('end', () => client.close());
});
}
// SETTINGS => SETTINGS => HEADERS => DATA
const MIN_FRAME_COUNT = 4;
server.listen(0, () => {
console.error('listening');
testRequest('/singleEnd', MIN_FRAME_COUNT, () => {
console.error('singleend');
testRequest('/sequentialEnd', MIN_FRAME_COUNT, () => {
console.error('sequentialend');
testRequest('/delayedEnd', MIN_FRAME_COUNT + 1, () => {
console.error('closing');
server.close();
});
});
});
});
setTimeout(() => { throw new Error('foo'); }, 5000).unref(); |
Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: nodejs#37639
Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: nodejs#37639
The text was updated successfully, but these errors were encountered: