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

This commit is contained in:
Nicolas Chaulet 2022-08-03 16:21:37 -04:00 committed by GitHub
parent 7f46fde188
commit 319cba32f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
@ -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'];
@ -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 {