Name the peer and the stalled phase on a connect timeout, and quote an untyped value
Mirror / push (push) Successful in 5s
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 19s
Test / test (20) (pull_request) Successful in 19s
Test / test (22) (pull_request) Successful in 24s
Test / test (24) (pull_request) Successful in 18s
Test / test (26) (pull_request) Successful in 19s
Mirror / push (push) Successful in 5s
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 19s
Test / test (20) (pull_request) Successful in 19s
Test / test (22) (pull_request) Successful in 24s
Test / test (24) (pull_request) Successful in 18s
Test / test (26) (pull_request) Successful in 19s
This commit is contained in:
@@ -1047,7 +1047,11 @@ describe('connectTimeout', () => {
|
||||
|
||||
assert.ok(settled, 'a handshake nothing answers is what the OS wait would swallow for minutes');
|
||||
assert.ok(settled.err instanceof Error);
|
||||
assert.match(settled.err.message, /Timed out connecting/);
|
||||
assert.match(
|
||||
settled.err.message,
|
||||
new RegExp(`Timed out completing the TLS handshake with 127\\.0\\.0\\.1:${String(port)} after 150 ms`),
|
||||
'a firewall and a peer that accepts then stalls need different answers from the operator',
|
||||
);
|
||||
assert.equal(settled.session, undefined);
|
||||
});
|
||||
|
||||
@@ -1090,9 +1094,14 @@ describe('connectTimeout', () => {
|
||||
);
|
||||
assert.match(checkSessionOptions({ connectTimeout: -1 }).err?.message ?? '', /connectTimeout/);
|
||||
assert.match(checkSessionOptions({ connectTimeout: 1.5 }).err?.message ?? '', /whole number/);
|
||||
assert.match(
|
||||
checkSessionOptions({ connectTimeout: '5000' }).err?.message ?? '',
|
||||
/got "5000"/,
|
||||
'an env var read without Number() is the commonest untyped value, and it is a correct number',
|
||||
);
|
||||
assert.match(
|
||||
checkSessionOptions({ connectTimeout: 2_147_483_648 }).err?.message ?? '',
|
||||
/2147483647 or less/,
|
||||
/2147483647 ms or less/,
|
||||
'a delay Node cannot hold in 32 bits fires after 1 ms, the inverse of what it asked for',
|
||||
);
|
||||
assert.equal(checkSessionOptions({ connectTimeout: 2_147_483_647 }).err, undefined);
|
||||
|
||||
@@ -1493,7 +1493,6 @@ describe('robustness', () => {
|
||||
// 0.4.0 registered a listener per sequence number and waited forever, leaking one per call.
|
||||
test('gives up on a peer that never answers', async t => {
|
||||
const accepted: net.Socket[] = [];
|
||||
// resume() so the socket drains; an unread socket never notices the peer hanging up.
|
||||
const silent = net.createServer(sock => { accepted.push(sock); sock.resume(); });
|
||||
|
||||
await new Promise<void>(resolve => silent.listen(0, resolve));
|
||||
|
||||
Reference in New Issue
Block a user