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

[ML] Single metric viewer functional test: add retry to reduce flakiness #188686

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Jul 18, 2024

Summary

Fixes #188493

This PR unskips the single metric viewer functional test that is failing (confirmed functionality is working as expected) and increases the retries to reduce flakiness.

Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6593

Checklist

Delete any items that are not applicable to this PR.

@alvarezmelissa87 alvarezmelissa87 self-assigned this Jul 18, 2024
@alvarezmelissa87 alvarezmelissa87 requested a review from a team as a code owner July 18, 2024 17:42
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#6581

[❌] x-pack/test/functional/apps/ml/anomaly_detection_integrations/config.ts: 9/35 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#6586

[❌] x-pack/test/functional/apps/ml/anomaly_detection_integrations/config.ts: 9/35 tests passed.

see run history

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -92,7 +92,7 @@ export function MachineLearningSingleMetricViewerProvider(
},

async ensureAnomalyActionDiscoverButtonClicked() {
await retry.tryForTime(3 * 1000, async () => {
await retry.tryForTime(10 * 1500, async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick nit on the format: we tend to only change the first factor and leave the * 1000 so it's easier to see at glance how many seconds this timeout is.

@@ -92,7 +92,7 @@ export function MachineLearningSingleMetricViewerProvider(
},

async ensureAnomalyActionDiscoverButtonClicked() {
await retry.tryForTime(3 * 1000, async () => {
await retry.tryForTime(10 * 1500, async () => {
await testSubjects.click('mlAnomaliesListRowAction_viewInDiscoverButton');
await testSubjects.existOrFail('discoverLayoutResizableContainer');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the failure screenshot it looks like the click didn't have an effect (might have been triggered too early) and the click should be retried. However looking into the test log, I can see that this existOrFail times out after 120 seconds and since the wrapping retry is on a shorter time out, it leaves the retry immediately and never actually triggers the click again.
I'd propose to give the existOrFail an explicit timeout (as much as we think makes sense for going to the dashboard page, e.g. 10 seconds) and then extend the wrapping retry so it actually gives it a few tries, something like this:

    async ensureAnomalyActionDiscoverButtonClicked() {
      await retry.tryForTime(30 * 1000, async () => {
        await testSubjects.click('mlAnomaliesListRowAction_viewInDiscoverButton');
        await testSubjects.existOrFail('discoverLayoutResizableContainer', { timeout: 10 * 1000 });
      });
    },

@peteharverson peteharverson self-requested a review July 19, 2024 09:04
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#6593

[✅] x-pack/test/functional/apps/ml/anomaly_detection_integrations/config.ts: 30/30 tests passed.

see run history

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes LGTM

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #7 / Template fields renders template fields with existing value

Metrics [docs]

✅ unchanged

History

cc @alvarezmelissa87

@alvarezmelissa87 alvarezmelissa87 merged commit c830fbb into elastic:main Jul 19, 2024
20 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 19, 2024
@alvarezmelissa87 alvarezmelissa87 deleted the ml-smv-test-resilient branch July 19, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment