diff --git a/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts b/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts index 7010b1f2c3b1e..7f6af525695cd 100644 --- a/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts +++ b/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts @@ -28,8 +28,8 @@ describe('requestDiagnostics', () => { describe('requestDiagnostics (singular)', () => { it('can request diagnostics for single agent', async () => { - const { esClient, agentInRegularDoc } = createClientMock(); - await requestDiagnostics(esClient, agentInRegularDoc._id); + const { soClient, esClient, agentInRegularDoc } = createClientMock(); + await requestDiagnostics(esClient, soClient, agentInRegularDoc._id); expect(esClient.create).toHaveBeenCalledWith( expect.objectContaining({ diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts index ad2d259594289..0c072db2bb94a 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts @@ -214,11 +214,11 @@ export default function (providerContext: FtrProviderContext) { } it('should only update tags of agents in the same space when passing a list of agent ids', async () => { - verifyAgentsTags({ + await verifyAgentsTags({ [defaultSpaceAgent1]: ['tag1'], [defaultSpaceAgent2]: ['tag1'], }); - verifyAgentsTags( + await verifyAgentsTags( { [testSpaceAgent1]: ['tag1'], [testSpaceAgent2]: ['tag1'], @@ -238,11 +238,11 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - verifyAgentsTags({ + await verifyAgentsTags({ [defaultSpaceAgent1]: ['tag1'], [defaultSpaceAgent2]: ['tag1'], }); - verifyAgentsTags( + await verifyAgentsTags( { [testSpaceAgent1]: ['tag1', 'space1'], [testSpaceAgent2]: ['tag1'], @@ -263,11 +263,11 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - verifyAgentsTags({ + await verifyAgentsTags({ [defaultSpaceAgent1]: ['tag1'], [defaultSpaceAgent2]: ['tag1'], }); - verifyAgentsTags( + await verifyAgentsTags( { [testSpaceAgent1]: ['tag1'], [testSpaceAgent2]: ['tag1'], @@ -286,11 +286,11 @@ export default function (providerContext: FtrProviderContext) { }); it('should only update tags of agents in the same space when passing a kuery', async () => { - verifyAgentsTags({ + await verifyAgentsTags({ [defaultSpaceAgent1]: ['tag1'], [defaultSpaceAgent2]: ['tag1'], }); - verifyAgentsTags( + await verifyAgentsTags( { [testSpaceAgent1]: ['tag1'], [testSpaceAgent2]: ['tag1'], @@ -310,11 +310,11 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - verifyAgentsTags({ + await verifyAgentsTags({ [defaultSpaceAgent1]: ['tag1'], [defaultSpaceAgent2]: ['tag1'], }); - verifyAgentsTags( + await verifyAgentsTags( { [testSpaceAgent1]: ['tag1', 'space1'], [testSpaceAgent2]: ['tag1', 'space1'], @@ -335,11 +335,11 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - verifyAgentsTags({ + await verifyAgentsTags({ [defaultSpaceAgent1]: ['tag1'], [defaultSpaceAgent2]: ['tag1'], }); - verifyAgentsTags( + await verifyAgentsTags( { [testSpaceAgent1]: ['tag1'], [testSpaceAgent2]: ['tag1'], @@ -635,11 +635,11 @@ export default function (providerContext: FtrProviderContext) { expect(agentPolicyIds).to.eql(expected); } - verifyAgentsPolicies({ + await verifyAgentsPolicies({ [defaultSpaceAgent1]: defaultSpacePolicy1.item.id, [defaultSpaceAgent2]: defaultSpacePolicy2.item.id, }); - verifyAgentsPolicies( + await verifyAgentsPolicies( { [testSpaceAgent1]: spaceTest1Policy1.item.id, [testSpaceAgent2]: spaceTest1Policy2.item.id, @@ -659,11 +659,11 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - verifyAgentsPolicies({ + await verifyAgentsPolicies({ [defaultSpaceAgent1]: defaultSpacePolicy1.item.id, [defaultSpaceAgent2]: defaultSpacePolicy2.item.id, }); - verifyAgentsPolicies( + await verifyAgentsPolicies( { [testSpaceAgent1]: spaceTest1Policy2.item.id, [testSpaceAgent2]: spaceTest1Policy2.item.id,