[Ingest Manager] Fix agent tests and short polling timeout (#79442)
This commit is contained in:
parent
5812217631
commit
28278abdda
|
@ -11,7 +11,12 @@
|
|||
|
||||
import { IRouter, RouteValidationResultFactory } from 'src/core/server';
|
||||
import Ajv from 'ajv';
|
||||
import { PLUGIN_ID, AGENT_API_ROUTES, LIMITED_CONCURRENCY_ROUTE_TAG } from '../../constants';
|
||||
import {
|
||||
PLUGIN_ID,
|
||||
AGENT_API_ROUTES,
|
||||
LIMITED_CONCURRENCY_ROUTE_TAG,
|
||||
AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS,
|
||||
} from '../../constants';
|
||||
import {
|
||||
GetAgentsRequestSchema,
|
||||
GetOneAgentRequestSchema,
|
||||
|
@ -124,7 +129,8 @@ export const registerRoutes = (router: IRouter, config: IngestManagerConfigType)
|
|||
},
|
||||
options: {
|
||||
tags: [],
|
||||
...(pollingRequestTimeout
|
||||
// If the timeout is too short, do not set socket idle timeout and rely on Kibana global socket timeout
|
||||
...(pollingRequestTimeout && pollingRequestTimeout > AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS
|
||||
? {
|
||||
timeout: {
|
||||
idleSocket: pollingRequestTimeout,
|
||||
|
|
|
@ -167,6 +167,12 @@ export async function createAgentActionFromPolicyAction(
|
|||
|
||||
function getPollingTimeoutMs() {
|
||||
const pollingTimeoutMs = appContextService.getConfig()?.fleet.pollingRequestTimeout ?? 0;
|
||||
|
||||
// If polling timeout is too short do not use margin
|
||||
if (pollingTimeoutMs <= AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS) {
|
||||
return pollingTimeoutMs;
|
||||
}
|
||||
|
||||
// Set a timeout 20s before the real timeout to have a chance to respond an empty response before socket timeout
|
||||
return Math.max(
|
||||
pollingTimeoutMs - AGENT_POLLING_REQUEST_TIMEOUT_MARGIN_MS,
|
||||
|
|
|
@ -19,8 +19,7 @@ export default function (providerContext: FtrProviderContext) {
|
|||
const supertestWithoutAuth = getSupertestWithoutAuth(providerContext);
|
||||
const esClient = getService('es');
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/75241
|
||||
describe.skip('fleet_agent_flow', () => {
|
||||
describe('fleet_agent_flow', () => {
|
||||
skipIfNoDockerRegistry(providerContext);
|
||||
before(async () => {
|
||||
await esArchiver.load('empty_kibana');
|
||||
|
|
Loading…
Reference in a new issue