elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.76k stars 8.16k forks source link

Failing test: X-Pack Saved Object Tagging Functional Tests.x-pack/test/saved_object_tagging/functional/tests/dashboard_integration·ts - saved objects tagging - functional tests dashboard integration creating allows to select tags for a new dashboard #160583

Open kibanamachine opened 1 year ago

kibanamachine commented 1 year ago

A test failed on a tracked branch

Error: retry.try timeout: Error: retry.try timeout: ElementClickInterceptedError: element click intercepted: Element <button type="button" class="css-1mia8h-euiButtonDisplay-s-defaultMinWidth-s-fill-primary" data-test-subj="dashboardSaveMenuItem">...</button> is not clickable at point (1536, 71). Other element would receive the click: <div data-euiportal="true" class="euiOverlayMask css-11w8yva-euiOverlayMask-aboveHeader" data-relative-to-header="above">...</div>
  (Session info: chrome=114.0.5735.133)
    at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:524:15)
    at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:601:13)
    at Executor.execute (node_modules/selenium-webdriver/lib/http.js:529:28)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Task.exec (prevent_parallel_calls.ts:28:20)
    at onFailure (retry_for_success.ts:17:9)
    at retryForSuccess (retry_for_success.ts:59:13)
    at RetryService.try (retry.ts:31:12)
    at Proxy.clickByCssSelector (find.ts:417:5)
    at TestSubjects.click (test_subjects.ts:164:5)
    at DashboardPageObject.enterDashboardTitleAndClickSave (dashboard_page.ts:523:7)
    at dashboard_page.ts:479:7
    at runAttempt (retry_for_success.ts:29:15)
    at retryForSuccess (retry_for_success.ts:68:21)
    at RetryService.try (retry.ts:31:12)
    at DashboardPageObject.saveDashboard (dashboard_page.ts:478:5)
    at Context.<anonymous> (dashboard_integration.ts:87:9)
    at Object.apply (wrap_function.js:73:16)
    at onFailure (retry_for_success.ts:17:9)
    at retryForSuccess (retry_for_success.ts:59:13)
    at RetryService.try (retry.ts:31:12)
    at DashboardPageObject.saveDashboard (dashboard_page.ts:478:5)
    at Context.<anonymous> (dashboard_integration.ts:87:9)
    at Object.apply (wrap_function.js:73:16)

First failure: CI Build - main

elasticmachine commented 1 year ago

Pinging @elastic/kibana-presentation (Team:Presentation)

ThomThomson commented 1 year ago

This is a strange one... it looks like it somehow missed the title input when typing it in, then tried to save?

saved objects tagging - functional tests dashboard integration creating allows t-29814279444f4d298f24b012c2e451886d9c481ab2ec65240025329c4f56ba13

nreese commented 1 year ago

This is a strange one... it looks like it somehow missed the title input when typing it in, then tried to save?

It is true that title input was not correctly entered, but there is an error in the retry logic. saveDashboard has a retry wrapper around a block that calls enterDashboardTitleAndClickSave. enterDashboardTitleAndClickSave clicks dashboardSaveMenuItem to open the save dialog. enterDashboardTitleAndClickSave fails because save dialog is not closed, so retry wrapper calls enterDashboardTitleAndClickSave again. This is where the test gets stuck because enterDashboardTitleAndClickSave clicks dashboardSaveMenuItem to open the save dialog (which is already open) and can not recover from this state. I can put up a PR to only click dashboardSaveMenuItem if the save dialog is not already open.

Inlined code from dashboard_page to highlight where the problem is

public async saveDashboard(
    dashboardName: string,
    saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true },
    clickMenuItem = true
  ) {
    await this.retry.try(async () => {
      await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions, clickMenuItem);

      if (saveOptions.needsConfirm) {
        await this.ensureDuplicateTitleCallout();
        await this.clickSave();
      }

      // Confirm that the Dashboard has actually been saved
      await this.testSubjects.existOrFail('saveDashboardSuccess');
    });
    const message = await this.common.closeToast();
    await this.header.waitUntilLoadingHasFinished();
    await this.common.waitForSaveModalToClose();

    const isInViewMode = await this.testSubjects.exists('dashboardEditMode');
    if (saveOptions.exitFromEditMode && !isInViewMode) {
      await this.clickCancelOutOfEditMode();
    }
    await this.header.waitUntilLoadingHasFinished();

    return message;
  }

public async enterDashboardTitleAndClickSave(
    dashboardTitle: string,
    saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true },
    clickMenuItem = true
  ) {
    if (clickMenuItem) {
// This fails on retry since 'dashboardSaveMenuItem' is not clickable because the dialog is already open.
      await this.testSubjects.click('dashboardSaveMenuItem');
    }
    const modalDialog = await this.testSubjects.find('savedObjectSaveModal');

    this.log.debug('entering new title');
    await this.testSubjects.setValue('savedObjectTitle', dashboardTitle);

    if (saveOptions.storeTimeWithDashboard !== undefined) {
      await this.setStoreTimeWithDashboard(saveOptions.storeTimeWithDashboard);
    }

    const saveAsNewCheckboxExists = await this.testSubjects.exists('saveAsNewCheckbox');
    if (saveAsNewCheckboxExists) {
      await this.setSaveAsNewCheckBox(Boolean(saveOptions.saveAsNew));
    }

    if (saveOptions.tags) {
      await this.selectDashboardTags(saveOptions.tags);
    }

    await this.clickSave();
    if (saveOptions.waitDialogIsClosed) {
      await this.testSubjects.waitForDeleted(modalDialog);
    }
  }
kibanamachine commented 11 months ago

New failure: CI Build - main

kibanamachine commented 8 months ago

New failure: CI Build - main

kibanamachine commented 7 months ago

New failure: CI Build - main

Heenawter commented 5 months ago

Ran the flaky test 100 times and it passed - it's also been awhile since this test last failed. Closing for now.

image

kibanamachine commented 4 months ago

New failure: kibana-on-merge - 8.14

kibanamachine commented 2 months ago

New failure: kibana-on-merge - main

kibanamachine commented 1 month ago

New failure: kibana-on-merge - main

mistic commented 1 month ago

Skipped.

main: a9d954e