Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Fix flaky package install version integration test #138034

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const fakeRequest = {
},
} as unknown as KibanaRequest;

const PACKAGES = ['fleet_server', 'system', 'nginx', 'apache'];

describe('Uprade package install version', () => {
let esServer: kbnTestServer.TestElasticsearchUtils;
let kbnServer: kbnTestServer.TestKibanaUtils;
Expand Down Expand Up @@ -145,8 +147,7 @@ describe('Uprade package install version', () => {
await stopServers();
});

// FLAKY: https://github.com/elastic/kibana/issues/137934
describe.skip('with package installed with a previous format install version', () => {
describe('with package installed with a previous format install version', () => {
let soClient: SavedObjectsClientContract;

const OUTDATED_PACKAGES = ['nginx', 'apache'];
Expand Down Expand Up @@ -184,6 +185,10 @@ describe('Uprade package install version', () => {

res.saved_objects.forEach((so) => {
expect(so.attributes.install_format_schema_version).toBe(FLEET_INSTALL_FORMAT_VERSION);
if (!PACKAGES.includes(so.attributes.name)) {
return;
}

if (!OUTDATED_PACKAGES.includes(so.attributes.name)) {
expect(new Date(so.updated_at as string).getTime()).toBeLessThan(now);
} else {
Expand Down