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

Getting flaky tests back in shape for reporting #46076

Merged
merged 20 commits into from
Jan 15, 2020
Merged

Getting flaky tests back in shape for reporting #46076

merged 20 commits into from
Jan 15, 2020

Conversation

joelgriffith
Copy link
Contributor

@joelgriffith joelgriffith commented Sep 18, 2019

This PR re-enables prior skipped flaky tests for reporting. A couple of highlights

  • Switching tabs to view the downloaded report broke in headless selenium. We fixed that by taking the URL of the report and downloaded it manually.

  • I’ve added an extra env variable to force a remote debugging port so we can remote debug headless

  • Added a new method to pause the browsers execution so we can see what’s going on at that exact moment.

@joelgriffith joelgriffith added the release_note:skip Skip the PR/issue when compiling release notes label Sep 18, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@joelgriffith
Copy link
Contributor Author

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@joelgriffith
Copy link
Contributor Author

joelgriffith commented Sep 18, 2019

                 │      Error: expected '{{#each _all}} {{ data.formatted.[0] }} {{ data.raw.[0] }} {{/each}}}}' to equal 'Sep 22, 2015 @ 06:00:00.000,6 1442901600000,6'
                 │       at Assertion.assert (packages/kbn-expect/expect.js:100:11)
                 │       at Assertion.be.Assertion.equal (packages/kbn-expect/expect.js:221:8)
                 │       at Assertion.(anonymous function) [as be] (packages/kbn-expect/expect.js:69:22)
                 │       at Context.be (test/functional/apps/visualize/_tsvb_markdown.ts:82:33)
                 │       at process._tickCallback (internal/process/next_tick.js:68:7)

Looks like failures elsewhere


return new class DashboardAddPanel {
// Dev-helper to pause the browser so we can inspect what's going on
// Not meant for usage in CI since it'll stop all execution
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this so you can pause the browser in places where you need to inspect stuff. Might need a better home than this file (common?)

@joelgriffith
Copy link
Contributor Author

Getting unrelated failures, merged master.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@joelgriffith
Copy link
Contributor Author

Some notes:

  • It appears headless webdriver has troubles changing tabs when one tab is not a site but a binary asset.
  • I've added a few sugar params for remote debugging headless.
  • Because of links to styles and js #1, I've instead opted to inject the payload URL into the toast notification via a data attribute. I'm not sure happy about it, however it seems to be the best alternative we have for the time being.
  • Some of percentage checks have bumped up in size, and I'm not sure as to why. Might be a good idea to use snapshots of some kind instead of this?

@@ -79,6 +80,10 @@ async function attemptToCreateCommand(log: ToolingLog, browserType: Browsers) {
// See: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
chromeOptions.push('headless', 'disable-gpu');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added this so you can remotely debug (view with devtools) the session as it's running headlessly

@@ -89,6 +89,7 @@ uiModules.get('kibana')
const downloadReportButton = (
<EuiButton
size="s"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is my hack to get the URL of the report, vs clicking on it and trying to navigate to that Tab in webdriver, which appears to not be working in headless (just freezes or crashes there). A pro is that this speeds up the tests!

Copy link
Member

Choose a reason for hiding this comment

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

This is genius!

@@ -30,34 +30,6 @@ export function ReportingPageProvider({ getService, getPageObjects }) {
await browser.setWindowSize(1600, 850);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer need theses now that we aren't tab-switching

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@joelgriffith
Copy link
Contributor Author

retest

@joelgriffith
Copy link
Contributor Author

Unrelated failure, our CI group passed. Merging master and pushing

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@joelgriffith
Copy link
Contributor Author

restest

@joelgriffith joelgriffith marked this pull request as ready for review September 21, 2019 05:15
@joelgriffith joelgriffith added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:Stack Services test_xpack_functional labels Sep 21, 2019
* @return {Promise<void>}
*/
public async pause() {
await driver.executeAsyncScript(`(async () => { debugger; return Promise.resolve(); })()`);
Copy link
Member

Choose a reason for hiding this comment

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

When/If this turns out to be useful, can you add a note in some developer docs about how to use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah! Great reminder, thanks!

@joelgriffith
Copy link
Contributor Author

@elasticmachine merge upstream

@joelgriffith
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM!

Reviewed the code

@joelgriffith
Copy link
Contributor Author

@elasticmachine merge upstream

@joelgriffith
Copy link
Contributor Author

One more run, then we'll see how the stress test does

@joelgriffith
Copy link
Contributor Author

@elasticmachine merge upstream

@joelgriffith
Copy link
Contributor Author

@elasticmachine merge upstream

@joelgriffith
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

👍 on the license checker changes.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tsullivan
Copy link
Member

@joelgriffith this PR would close #23842 correct?

@joelgriffith joelgriffith merged commit 5b2e315 into elastic:master Jan 15, 2020
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 17, 2020
* Rebasing from master, updating test utils and getting report pdf/png generation

* Removing legacy functions, packages and updating README/Licenses

* Dropping duplicitive test

* Better URL check for lens reporting

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead release_note:skip Skip the PR/issue when compiling release notes v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants