Skip to content

Commit 411b133

Browse files
Trottevanlucas
authored andcommitted
test: fix freebsd10-64 CI failures
Remove unneeded timers from some tests and move others from parallel testing to sequential testing. This is to resolve test failures on freebsd10-64 on CI. The failures are all due to timers firing later than expected. Timers firing later than they are set for can happen on resource-constrained hosts and is not a bug. In general, it may be wise to put tests that depend on timing into sequential testing rather than parallel testing, as the timing can be affected by other simultaneously-running test processes. Fixes: #8041 Fixes: #9227 PR-URL: #9317 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Julien Gilli <jgilli@nodejs.org> Reviewed-By: Johan Bergstrom <bugs@bergstroem.nu> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent 4e3731c commit 411b133

7 files changed

+3
-21
lines changed

β€Žtest/parallel/test-dgram-send-callback-multi-buffer.js

-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ const dgram = require('dgram');
66

77
const client = dgram.createSocket('udp4');
88

9-
const timer = setTimeout(function() {
10-
throw new Error('Timeout');
11-
}, common.platformTimeout(200));
12-
139
const messageSent = common.mustCall(function messageSent(err, bytes) {
1410
assert.equal(bytes, buf1.length + buf2.length);
15-
clearTimeout(timer);
1611
});
1712

1813
const buf1 = Buffer.alloc(256, 'x');

β€Žtest/parallel/test-dgram-send-multi-buffer-copy.js

-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ const dgram = require('dgram');
66

77
const client = dgram.createSocket('udp4');
88

9-
const timer = setTimeout(function() {
10-
throw new Error('Timeout');
11-
}, common.platformTimeout(200));
12-
139
const onMessage = common.mustCall(function(err, bytes) {
1410
assert.equal(bytes, buf1.length + buf2.length);
15-
clearTimeout(timer);
1611
});
1712

1813
const buf1 = Buffer.alloc(256, 'x');

β€Žtest/parallel/test-tls-server-failed-handshake-emits-clienterror.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,19 @@ const assert = require('assert');
1111

1212
const bonkers = Buffer.alloc(1024, 42);
1313

14-
let tlsClientErrorEmited = false;
1514

1615
const server = tls.createServer({})
1716
.listen(0, function() {
1817
const c = net.connect({ port: this.address().port }, function() {
1918
c.write(bonkers);
2019
});
2120

22-
}).on('tlsClientError', function(e) {
23-
tlsClientErrorEmited = true;
21+
}).on('tlsClientError', common.mustCall(function(e) {
2422
assert.ok(e instanceof Error,
2523
'Instance of Error should be passed to error handler');
2624
assert.ok(e.message.match(
2725
/SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol/),
2826
'Expecting SSL unknown protocol');
29-
});
3027

31-
setTimeout(function() {
32-
server.close();
33-
34-
assert.ok(tlsClientErrorEmited,
35-
'tlsClientError should be emited');
36-
37-
}, common.platformTimeout(200));
28+
server.close();
29+
}));

0 commit comments

Comments
Β (0)