Skip to content

Commit

Permalink
Unskip flaky suites in agent service jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Nov 29, 2023
1 parent d1402af commit 1dc9f70
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
11 changes: 9 additions & 2 deletions x-pack/plugins/fleet/server/services/agents/crud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jest.mock('../audit_logging');
jest.mock('../../../common/services/is_agent_upgradeable', () => ({
isAgentUpgradeable: jest.fn().mockImplementation((agent: Agent) => agent.id.includes('up')),
}));
jest.mock('./versions', () => {
return {
getAvailableVersions: jest
.fn()
.mockResolvedValue(['8.4.0', '8.5.0', '8.6.0', '8.7.0', '8.8.0']),
getLatestAvailableVersion: jest.fn().mockResolvedValue('8.8.0'),
};
});

const mockedAuditLoggingService = auditLoggingService as jest.Mocked<typeof auditLoggingService>;

Expand Down Expand Up @@ -151,8 +159,7 @@ describe('Agents CRUD test', () => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/171541
describe.skip('getAgentsByKuery', () => {
describe('getAgentsByKuery', () => {
it('should return upgradeable on first page', async () => {
searchMock
.mockImplementationOnce(() => Promise.resolve(getEsResponse(['1', '2', '3', '4', '5'], 7)))
Expand Down
15 changes: 10 additions & 5 deletions x-pack/plugins/fleet/server/services/agents/upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ import { sendUpgradeAgentsActions } from './upgrade';
import { createClientMock } from './action.mock';
import { getRollingUpgradeOptions, upgradeBatch } from './upgrade_action_runner';

jest.mock('./versions', () => {
return {
getAvailableVersions: jest
.fn()
.mockResolvedValue(['8.4.0', '8.5.0', '8.6.0', '8.7.0', '8.8.0']),
getLatestAvailableVersion: jest.fn().mockResolvedValue('8.8.0'),
};
});

jest.mock('./action_status', () => {
return {
getCancelledActions: jest.fn().mockResolvedValue([
Expand All @@ -25,11 +34,7 @@ jest.mock('./action_status', () => {
};
});

// FLAKY: https://github.com/elastic/kibana/issues/171052
// FLAKY: https://github.com/elastic/kibana/issues/172114
// FLAKY: https://github.com/elastic/kibana/issues/171536
// FLAKY: https://github.com/elastic/kibana/issues/171160
describe.skip('sendUpgradeAgentsActions (plural)', () => {
describe('sendUpgradeAgentsActions (plural)', () => {
beforeEach(async () => {
appContextService.start(createAppContextStartContractMock());
});
Expand Down

0 comments on commit 1dc9f70

Please sign in to comment.