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

Failing test: Jest Tests.x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table - UserAlertsTable should render the updated at subtitle #132360

Closed
kibanamachine opened this issue May 17, 2022 · 5 comments · Fixed by #131828
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test fixed Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented May 17, 2022

A test failed on a tracked branch

TestingLibraryElementError: Unable to find an element with the text: Updated now. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, <script />, <style />
<body>
  <div
    aria-atomic="true"
    aria-live="assertive"
    id="rbd-announcement-0"
    style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
  />
  <div
    aria-atomic="true"
    aria-live="assertive"
    id="rbd-announcement-1"
    style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
  />
  <div>
    <div
      class="sc-pRtAn kKDpeQ"
      data-test-subj="hoverVisibilityContainer"
    >
      <div
        class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPanel--hasBorder sc-qWSYE fYuDbC"
        data-test-subj="severityUserAlertsPanel"
      >
        <header
          class="sc-pjHjD kepMVA toggle-expand siemHeaderSection"
          data-test-subj="header-section"
        >
          <div
            class="euiFlexGroup euiFlexGroup--gutterExtraSmall euiFlexGroup--directionColumn"
          >
            <div
              class="euiFlexItem"
            >
              <div
                class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow euiFlexGroup--responsive"
              >
                <div
                  class="euiFlexItem"
                >
                  <div
                    class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow"
                  >
                    <div
                      class="euiFlexItem"
                    >
                      <div
                        class="euiFlexGroup euiFlexGroup--directionRow header-section-titles"
                      >
                        <div
                          class="euiFlexItem euiFlexItem--flexGrowZero"
                        >
                          <button
                            aria-label="Open"
                            class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--small"
                            data-test-subj="query-toggle-header"
                            title="Open"
                            type="button"
                          >
                            <span
                              aria-hidden="true"
                              class="euiButtonIcon__icon"
                              color="inherit"
                              data-euiicon-type="arrowDown"
                            />
                          </button>
                        </div>
                        <div
                          class="euiFlexItem"
                        >
                          <h4
                            class="euiTitle euiTitle--small"
                            data-test-subj="header-section-title"
                          >
                            <span
                              class="eui-textBreakNormal"
                            >
                              Vulnerable users by severity
                            </span>
                          </h4>
                        </div>
                      </div>
                    </div>
                    <div
                      class="euiFlexItem euiFlexItem--flexGrowZero"
                    >
                      <button
                        aria-label="Inspect"
                        class="euiButtonIcon euiButtonIcon-isDisabled euiButtonIcon--primary euiButtonIcon--empty euiButtonIcon--xSmall inspectButtonComponent"
                        data-test-subj="inspect-icon-button"
                        disabled=""
                        title="Inspect"
                        type="button"
                      >
                        <span
                          aria-hidden="true"
                          class="euiButtonIcon__icon"
                          color="inherit"
                          data-euiicon-type="inspect"
                        />
                      </button>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div
              class="euiFlexItem"
            >
              <div
                class="sc-pciEQ dKWKBC siemSubtitle"
              >
                <div
                  class="siemSubtitle__item siemSubtitle__item--node"
                  data-test-subj="header-panel-subtitle"
                >
                  <div
                    class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
                  >
                    <div
                      class="euiFlexItem euiFlexItem--flexGrowZero"
                    >
                      Updated
                       
                      1 second ago
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </header>
        <div
          class="euiBasicTable"
          data-test-subj="severityUserAlertsTable"
        >
          <div>
            <div
              class="euiTableHeaderMobile"
            >
              <div
                class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsBaseline euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow"
              >
                <div
                  class="euiFlexItem euiFlexItem--flexGrowZero"
                />
                <div
                  class="euiFlexItem euiFlexItem--flexGrowZero"
                />
              </div>
            </div>
            <table
              class="euiTable euiTable--responsive"
              id="__table_generated-id"
              tabindex="-1"
            >
              <caption
                class="euiScreenReaderOnly euiTableCaption"
              />
              <thead>
                <tr>
                  <th
                    class="euiTableHeaderCell"
                    data-test-subj="tableHeaderCell_userName_0"
                    role="columnheader"
                    scope="col"
                  >
                    <span
                      class="euiTableCellContent"
                    >
                      <span
                        class="euiTableCellContent__text"
                        title="User name"
                      >
                        User name
                      </span>
                    </span>
                  </th>
                  <th
                    class="euiTableHeaderCell"
                    data-test-subj="tableHeaderCell_totalAlerts_1"
                    role="columnheader"
                    scope="col"
                  >
                    <span
                      class="euiTableCellContent"
                    >
                      <span
                        class="euiTableCellContent__text"
                        title="Alerts"
                      >
                        Alerts
                      </span>
                    </span>
                  </th>
                  <th
                    class="euiTableHeaderCell"
                    data-test-subj="tableHeaderCell_critical_2"
                    role="columnheader"
                    scope="col"
                  >
                    <span
                      class="euiTableCellContent"
                    >
                      <span
                        class="euiTableCellContent__text"
                        title="Critical"
                      >
                        Critical
                      </span>
                    </span>
                  </th>
                  <th
                    class="euiTableHeaderCell"
                    data-test-subj="tableHeaderCell_high_3"
                    role="columnheader"
                    scope="col"
                  >
                    <span
                      class="euiTableCellContent"
                    >
                      <span
                        class="euiTableCellContent__text"
                        title="High"
                      >
                        High
                      </span>
                    </span>
                  </th>
                  <th
                    class="euiTableHeaderCell"
                    data-test-subj="tableHeaderCell_medium_4"
                    role="columnheader"
                    scope="col"
                  >
                    <span
                      class="euiTableCellContent"
                    >
                      <span
                        class="euiTableCellContent__text"
                        title="Medium"
                      >
                        Medium
                      </span>
                    </span>
                  </th>
                  <th
                    class="euiTableHeaderCell"
                    data-test-subj="tableHeaderCell_low_5"
                    role="columnheader"
                    scope="col"
                  >
                    <span
                      class="euiTableCellContent"
                    >
                      <span
                        class="euiTableCellContent__text"
                        title="Low"
                      >
                        Low
                      </span>
                    </span>
                  </th>
                </tr>
              </thead>
              <tbody>
                <tr
                  class="euiTableRow"
                >
                  <td
                    class="euiTableRowCell euiTableRowCell--middle"
                    colspan="6"
                  >
                    <div
                      class="euiTableCellContent euiTableCellContent--alignCenter"
                    >
                      <span
                        class="euiTableCellContent__text"
                      >
                        <div
                          class="euiPanel euiPanel--borderRadiusMedium euiPanel--transparent euiPanel--noShadow euiEmptyPrompt euiEmptyPrompt--vertical euiEmptyPrompt--paddingLarge"
                        >
                          <div
                            class="euiEmptyPrompt__main"
                          >
                            <div
                              class="euiEmptyPrompt__content"
                            >
                              <div
                                class="euiEmptyPrompt__contentInner"
                              >
                                <h3
                                  class="euiTitle euiTitle--xsmall"
                                >
                                  No alerts to display
                                </h3>
                              </div>
                            </div>
                          </div>
                        </div>
                      </span>
                    </div>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
        <div
          class="euiSpacer euiSpacer--m css-hg1jdf-euiSpacer-m"
        />
        <button
          class="euiButton euiButton--primary"
          data-test-subj="severityUserAlertsButton"
          type="button"
        >
          <span
            class="euiButtonContent euiButton__content"
          >
            <span
              class="euiButton__text"
            >
              View all users
            </span>
          </span>
        </button>
      </div>
    </div>
  </div>
  <div
    aria-atomic="true"
    aria-live="assertive"
    id="rbd-announcement-2"
    style="position: absolute; width: 1px; height: 1px; margin: -1px; border: 0px; padding: 0px; overflow: hidden; clip-path: inset(100%);"
  />
  <div
    id="rbd-hidden-text-2-hidden-text-2"
    style="display: none;"
  >
    
  Press space bar to start a drag.
  When dragging you can use the arrow keys to move the item around and escape to cancel.
  Some screen readers may require you to be in focus mode or to use your pass through key

  </div>
</body>
    at Object.getElementError (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/config.js:38:19)
    at /var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/query-helpers.js:90:38
    at /var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/query-helpers.js:62:17
    at getByText (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/@testing-library/dom/dist/query-helpers.js:111:19)
    at Object.<anonymous> (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx:76:12)
    at Promise.then.completed (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/utils.js:276:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/utils.js:216:10)
    at _callCircusTest (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:212:40)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at _runTest (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/buildkite-agent/builds/kb-n2-4-spot-3d61a7ce9b9f10a9/elastic/kibana-on-merge/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

First failure: CI Build - main

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label May 17, 2022
@botelastic botelastic bot added the needs-team Issues missing a team label label May 17, 2022
@kibanamachine kibanamachine added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label May 17, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@botelastic botelastic bot removed the needs-team Issues missing a team label label May 17, 2022
@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

spalger pushed a commit that referenced this issue May 18, 2022
@spalger
Copy link
Contributor

spalger commented May 18, 2022

Jest tests should never be flaky skipped in main/8.3: cae61c2

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@jamster10
Copy link
Contributor

This issue was resolved in #131827 😄. It was due to the async behaviour of the test, causing the expected text to already be gone by the time the test was checking for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test fixed Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team
Projects
None yet
6 participants