fix: align api keepalive with gateway pool
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { configureApiHttpServerTimeouts } from './http-server-timeouts';
|
||||
|
||||
describe('configureApiHttpServerTimeouts', () => {
|
||||
it('keeps the API connection alive longer than the Gateway idle pool', () => {
|
||||
const server = { keepAliveTimeout: 0, headersTimeout: 0 };
|
||||
expect(configureApiHttpServerTimeouts(server, {})).toEqual({
|
||||
keepAliveTimeoutMs: 120_000,
|
||||
headersTimeoutMs: 125_000,
|
||||
});
|
||||
expect(server).toEqual({ keepAliveTimeout: 120_000, headersTimeout: 125_000 });
|
||||
});
|
||||
|
||||
it('keeps headers timeout above a configured keep-alive timeout', () => {
|
||||
const server = { keepAliveTimeout: 0, headersTimeout: 0 };
|
||||
expect(configureApiHttpServerTimeouts(server, {
|
||||
API_HTTP_KEEP_ALIVE_TIMEOUT_MS: '90000',
|
||||
API_HTTP_HEADERS_TIMEOUT_MS: '1000',
|
||||
})).toEqual({ keepAliveTimeoutMs: 90_000, headersTimeoutMs: 91_000 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user