Skip to content

Commit 08f9411

Browse files
author
Thomas Watson
committed
Increase server close timeout
Prior to Node.js 19.0.0, calling close while an idle client was connected to a server would not actually close the server before the client disconnected. This behavior was modified in Node.js 19.0.0: nodejs/node#43522 This resulted in our mock server being closed before we expected and as a result, some of the tests in `cluster.test.js` would fail. This is because the 1 second timeout is lower than the exponential backoff logic in the `_autoRetry` function inside the `native_realm.js` file. To get around this issue, the timeout have simply been incresed to 5 seconds instead of 1. This is not pretty, but it gets the job done.
1 parent 460fba9 commit 08f9411

File tree

1 file changed

+2
-2
lines changed
  • packages/kbn-es/src/integration_tests/__fixtures__

1 file changed

+2
-2
lines changed

packages/kbn-es/src/integration_tests/__fixtures__/es_bin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ const { ES_KEY_PATH, ES_CERT_PATH } = require('@kbn/dev-utils');
8787
}
8888
);
8989

90-
// setup server auto close after 1 second of silence
90+
// setup server auto close after 5 second of silence
9191
let serverCloseTimer;
9292
const delayServerClose = () => {
9393
clearTimeout(serverCloseTimer);
94-
serverCloseTimer = setTimeout(() => server.close(), 1000);
94+
serverCloseTimer = setTimeout(() => server.close(), 5000);
9595
};
9696
server.on('request', delayServerClose);
9797
server.on('listening', delayServerClose);

0 commit comments

Comments
 (0)