Skip to content

Commit

Permalink
[Fleet] Reenable flaky test and add longer timeout (#194843)
Browse files Browse the repository at this point in the history
Closes #192999
## Summary

[Fleet] Reenable skipped flaky test. The
[beforeEach](#192999) conditions
in this test keep failing because they take longer than the 5s timeout
allowed for each test.

Here I'm adding an 8s timeout to attempt fixing it.


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
  • Loading branch information
criamico authored Oct 3, 2024
1 parent 326f813 commit a7268c4
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ import { ExperimentalFeaturesService } from '../../../../services';
import type { DetailViewPanelName } from '.';
import { Detail } from '.';

// Default timeout for tests is 5s, increasing to 8s due to long running requests leading to frequent flakyness
const TESTS_TIMEOUT = 8000;

// @ts-ignore this saves us having to define all experimental features
ExperimentalFeaturesService.init({});

// Failing: See https://github.com/elastic/kibana/issues/192999
describe.skip('when on integration detail', () => {
describe('When on integration detail', () => {
const pkgkey = 'nginx-0.3.7';
const detailPageUrlPath = pagePathGetters.integration_details_overview({ pkgkey })[1];
let testRenderer: TestRenderer;
Expand Down Expand Up @@ -75,7 +77,7 @@ describe.skip('when on integration detail', () => {
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
});
}, TESTS_TIMEOUT);

it('should display agent policy usage count', async () => {
expect(renderResult.queryByTestId('agentPolicyCount')).not.toBeNull();
Expand Down Expand Up @@ -113,7 +115,7 @@ describe.skip('when on integration detail', () => {
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
});
}, TESTS_TIMEOUT);

it('should NOT display agent policy usage count', async () => {
expect(renderResult.queryByTestId('agentPolicyCount')).toBeNull();
Expand Down Expand Up @@ -151,7 +153,7 @@ describe.skip('when on integration detail', () => {
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
});
}, TESTS_TIMEOUT);

it('should NOT display agent policy usage count', async () => {
expect(renderResult.queryByTestId('agentPolicyCount')).toBeNull();
Expand All @@ -178,7 +180,7 @@ describe.skip('when on integration detail', () => {
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
});
}, TESTS_TIMEOUT);

it('should show overview and settings tabs', () => {
const tabs: DetailViewPanelName[] = ['overview', 'settings'];
Expand Down Expand Up @@ -284,7 +286,7 @@ describe.skip('when on integration detail', () => {
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
});
}, TESTS_TIMEOUT);

afterEach(() => {
// @ts-ignore
Expand Down Expand Up @@ -314,7 +316,7 @@ describe.skip('when on integration detail', () => {
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
await act(() => mockedApi.waitForApi());
});
}, TESTS_TIMEOUT);

it('should link to the create page', () => {
const addButton = renderResult.getByTestId('addIntegrationPolicyButton') as HTMLAnchorElement;
Expand Down

0 comments on commit a7268c4

Please sign in to comment.