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

[Metrics UI] fix flaky anomaly flyout functional test #100504

Merged
11 changes: 8 additions & 3 deletions x-pack/test/functional/apps/infra/metrics_anomalies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const infraSourceConfigurationForm = getService('infraSourceConfigurationForm');

// Failing: See https://github.com/elastic/kibana/issues/100445
describe.skip('Metrics UI Anomaly Flyout', function () {
describe('Metrics UI Anomaly Flyout', function () {
before(async () => {
await esArchiver.load('empty_kibana');
});
Expand Down Expand Up @@ -62,16 +62,20 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await esArchiver.unload('infra/metrics_anomalies');
});
it('renders the anomaly table with anomalies', async () => {
// default threshold should already be 50 but trying to prevent unknown flakiness by setting it
// https://github.com/elastic/kibana/issues/100445
await pageObjects.infraHome.goToSettings();
await pageObjects.infraHome.setAnomaliesThreshold('50');
await infraSourceConfigurationForm.saveConfiguration();
await pageObjects.infraHome.goToInventory();
await pageObjects.infraHome.openAnomalyFlyout();
await pageObjects.infraHome.goToAnomaliesTab();
await pageObjects.infraHome.clickHostsAnomaliesDropdown();
await pageObjects.infraHome.setAnomaliesDate('Apr 21, 2021 @ 00:00:00.000');
const hostAnomalies = await pageObjects.infraHome.findAnomalies();
// expect 2 anomalies with default Anomaly Severity Threshold setting (50)
expect(hostAnomalies.length).to.be(2);
await pageObjects.infraHome.clickK8sAnomaliesDropdown();
const k8sAnomalies = await pageObjects.infraHome.findAnomalies();
// expect 3 anomalies with default Anomaly Severity Threshold setting (50)
expect(k8sAnomalies.length).to.be(1);
await pageObjects.infraHome.closeFlyout();
});
Expand All @@ -93,6 +97,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await pageObjects.infraHome.openAnomalyFlyout();
await pageObjects.infraHome.goToAnomaliesTab();
await pageObjects.infraHome.clickHostsAnomaliesDropdown();
await pageObjects.infraHome.setAnomaliesDate('Apr 21, 2021 @ 00:00:00.000');
const hostAnomalies = await pageObjects.infraHome.findAnomalies();
expect(hostAnomalies.length).to.be(4);
await pageObjects.infraHome.clickK8sAnomaliesDropdown();
Expand Down