Browse Source

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: https://github.com/nodejs/node/issues/8041
Fixes: https://github.com/nodejs/node/issues/9227
PR-URL: https://github.com/nodejs/node/pull/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>
v6
Rich Trott 8 years ago
parent
commit
6ef636c0c9
  1. 5
      test/parallel/test-dgram-send-callback-multi-buffer.js
  2. 5
      test/parallel/test-dgram-send-multi-buffer-copy.js
  3. 12
      test/parallel/test-tls-server-failed-handshake-emits-clienterror.js
  4. 0
      test/sequential/test-http-client-timeout-with-data.js
  5. 0
      test/sequential/test-http-server-consumed-timeout.js
  6. 0
      test/sequential/test-timers-blocking-callback.js
  7. 0
      test/sequential/test-timers-same-timeout-wrong-list-deleted.js

5
test/parallel/test-dgram-send-callback-multi-buffer.js

@ -6,13 +6,8 @@ const dgram = require('dgram');
const client = dgram.createSocket('udp4');
const timer = setTimeout(function() {
throw new Error('Timeout');
}, common.platformTimeout(200));
const messageSent = common.mustCall(function messageSent(err, bytes) {
assert.equal(bytes, buf1.length + buf2.length);
clearTimeout(timer);
});
const buf1 = Buffer.alloc(256, 'x');

5
test/parallel/test-dgram-send-multi-buffer-copy.js

@ -6,13 +6,8 @@ const dgram = require('dgram');
const client = dgram.createSocket('udp4');
const timer = setTimeout(function() {
throw new Error('Timeout');
}, common.platformTimeout(200));
const onMessage = common.mustCall(function(err, bytes) {
assert.equal(bytes, buf1.length + buf2.length);
clearTimeout(timer);
});
const buf1 = Buffer.alloc(256, 'x');

12
test/parallel/test-tls-server-failed-handshake-emits-clienterror.js

@ -11,7 +11,6 @@ const assert = require('assert');
const bonkers = Buffer.alloc(1024, 42);
let tlsClientErrorEmited = false;
const server = tls.createServer({})
.listen(0, function() {
@ -19,19 +18,12 @@ const server = tls.createServer({})
c.write(bonkers);
});
}).on('tlsClientError', function(e) {
tlsClientErrorEmited = true;
}).on('tlsClientError', common.mustCall(function(e) {
assert.ok(e instanceof Error,
'Instance of Error should be passed to error handler');
assert.ok(e.message.match(
/SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol/),
'Expecting SSL unknown protocol');
});
setTimeout(function() {
server.close();
assert.ok(tlsClientErrorEmited,
'tlsClientError should be emited');
}, common.platformTimeout(200));
}));

0
test/parallel/test-http-client-timeout-with-data.js → test/sequential/test-http-client-timeout-with-data.js

0
test/parallel/test-http-server-consumed-timeout.js → test/sequential/test-http-server-consumed-timeout.js

0
test/parallel/test-timers-blocking-callback.js → test/sequential/test-timers-blocking-callback.js

0
test/parallel/test-timers-same-timeout-wrong-list-deleted.js → test/sequential/test-timers-same-timeout-wrong-list-deleted.js

Loading…
Cancel
Save