Skip to content

Commit 24ec50c

Browse files
committed
debug: insert console.logs for detecting where the test times out. Will be squashed later.
1 parent 07034b4 commit 24ec50c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/parallel/test-http-client-immediate-error.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
// net.createConnection().
66

77
const common = require('../common');
8+
console.log('require completed: common', Date.now());
89
const assert = require('assert');
10+
console.log('require completed: assert', Date.now());
911
const net = require('net');
12+
console.log('require completed: net', Date.now());
1013
const http = require('http');
14+
console.log('require completed: http', Date.now());
1115
const { internalBinding } = require('internal/test/binding');
16+
console.log('require completed: internal/test/binding', Date.now());
1217
const { UV_ENETUNREACH, UV_EADDRINUSE } = internalBinding('uv');
1318
const {
1419
newAsyncId,
1520
symbols: { async_id_symbol }
1621
} = require('internal/async_hooks');
22+
console.log('require completed: internal/async_hooks', Date.now());
1723

1824
const config = {
1925
host: 'http://example.com',
@@ -57,23 +63,28 @@ const handleWithBind = {
5763
const agentWithoutBind = agentFactory(handleWithoutBind, 3);
5864
const agentWithBind = agentFactory(handleWithBind, 2);
5965

66+
console.log('test initiated: test-1', Date.now());
6067
http.get({
6168
host: '127.0.0.1',
6269
port: 1,
6370
agent: agentWithoutBind,
6471
}).on('error', common.mustCall((err) => {
6572
assert.strictEqual(err.code, 'ENETUNREACH');
73+
console.log('test completed: test-1', Date.now());
6674
}));
6775

76+
console.log('test initiated: test-2', Date.now());
6877
http.request(config.host, {
6978
agent: agentWithoutBind,
7079
lookup(_0, _1, cb) {
7180
cb(null, config.connectMultiple);
7281
},
7382
}).on('error', common.mustCall((err) => {
7483
assert.strictEqual(err.code, 'ENETUNREACH');
84+
console.log('test completed: test-2', Date.now());
7585
}));
7686

87+
console.log('test initiated: test-3', Date.now());
7788
http.request(config.host, {
7889
agent: agentWithoutBind,
7990
lookup(_0, _1, cb) {
@@ -82,16 +93,20 @@ http.request(config.host, {
8293
family: 4,
8394
}).on('error', common.mustCall((err) => {
8495
assert.strictEqual(err.code, 'ENETUNREACH');
96+
console.log('test completed: test-3', Date.now());
8597
}));
8698

99+
console.log('test initiated: test-4', Date.now());
87100
http.request(config.host, {
88101
agent: agentWithBind,
89102
family: 4, // We specify 'family' so 'internalConnect' is invoked
90103
localPort: 2222 // Required to trigger _handle.bind()
91104
}).on('error', common.mustCall((err) => {
92105
assert.strictEqual(err.code, 'EADDRINUSE');
106+
console.log('test completed: test-4', Date.now());
93107
}));
94108

109+
console.log('test initiated: test-5', Date.now());
95110
http.request(config.host, {
96111
agent: agentWithBind,
97112
lookup(_0, _1, cb) {
@@ -100,4 +115,5 @@ http.request(config.host, {
100115
localPort: 2222, // Required to trigger _handle.bind()
101116
}).on('error', common.mustCall((err) => {
102117
assert.strictEqual(err.code, 'EADDRINUSE');
118+
console.log('test completed: test-5', Date.now());
103119
}));

0 commit comments

Comments
 (0)