kibana icon indicating copy to clipboard operation
kibana copied to clipboard

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

Open kibanamachine opened this issue 2 years ago • 8 comments

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

kibanamachine avatar Jun 27 '23 07:06 kibanamachine

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

elasticmachine avatar Jun 27 '23 10:06 elasticmachine

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

ThomThomson avatar Jun 27 '23 14:06 ThomThomson

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);
    }
  }

nreese avatar Jun 27 '23 21:06 nreese

New failure: CI Build - main

kibanamachine avatar Oct 09 '23 15:10 kibanamachine

New failure: CI Build - main

kibanamachine avatar Jan 20 '24 21:01 kibanamachine

New failure: CI Build - main

kibanamachine avatar Feb 29 '24 06:02 kibanamachine

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

image

Heenawter avatar Apr 17 '24 18:04 Heenawter

New failure: kibana-on-merge - 8.14

kibanamachine avatar May 10 '24 23:05 kibanamachine

New failure: kibana-on-merge - main

kibanamachine avatar Jul 31 '24 09:07 kibanamachine

New failure: kibana-on-merge - main

kibanamachine avatar Aug 06 '24 21:08 kibanamachine

Skipped.

main: a9d954e

mistic avatar Aug 06 '24 23:08 mistic