Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix flaky test-https-set-timeout-server
Because of a race condition, connection listener may not be invoked if
test is run under load. Remove `common.mustCall()` wrapper from the
listener. Move the test to `parallel` because it now works under load.
Make similar change to http test to keep them in synch even though it is
much harder to trigger the race in http.

Fixes: #14133
  • Loading branch information
Trott committed Jul 8, 2017
commit 25d61006817b354a14199a5b00264e76f00d8f14
7 changes: 4 additions & 3 deletions test/parallel/test-http-set-timeout-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ function run() {
}

test(function serverTimeout(cb) {
const server = http.createServer(common.mustCall((req, res) => {
// just do nothing, we should get a timeout event.
}));
const server = http.createServer((req, res) => {
// Do nothing. We should get a timeout event.
// Might not be invoked. Do not wrap in common.mustCall().
});
server.listen(common.mustCall(() => {
const s = server.setTimeout(50, common.mustCall((socket) => {
socket.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ function run() {
test(function serverTimeout(cb) {
const server = https.createServer(
serverOptions,
common.mustCall((req, res) => {
// just do nothing, we should get a timeout event.
}));
(req, res) => {
// Do nothing. We should get a timeout event.
// Might not be invoked. Do not wrap in common.mustCall().
});
server.listen(common.mustCall(() => {
const s = server.setTimeout(50, common.mustCall((socket) => {
socket.destroy();
Expand Down