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

[Fleet] Fix failing/flaky tests #189559

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

kpollich
Copy link
Member

@kpollich kpollich commented Jul 30, 2024

Summary

Closes #184310
Closes #180071
Closes #109017

Fixes several flaky/failing tests that were qualified as 8.15.0 blockers.

@kpollich kpollich added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.15.0 labels Jul 30, 2024
@kpollich kpollich self-assigned this Jul 30, 2024
@kpollich kpollich requested a review from a team as a code owner July 30, 2024 18:37
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

original: {
foo: 'bar',
},
original: JSON.stringify({ foo: 'bar' }),
Copy link
Member Author

Choose a reason for hiding this comment

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

The ES client seems to no longer coerce this value to a string under the hood, and event.original is mapped as keyword, so it needs to be a string.

skipIfNoDockerRegistry(providerContext);
setupFleetAndAgents(providerContext);

afterEach(async () => {
await deletePackage('apm', '8.8.0');
});

it('should rollover hidden datastreams when failed to update mappings', async function () {
Copy link
Member Author

Choose a reason for hiding this comment

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

The update between the two fixture versions of APM we maintain in the FTR directory no longer triggers a mapping conflict, likely because of upstream changes in Elasticsearch. Rather than try to find a new means to trigger a mapping conflict here, I think removing this in favor of the existing test coverage in Fleet's unit tests is sufficient.

@@ -14,8 14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'home']);
const kibanaServer = getService('kibanaServer');

// FLAKY: https://github.com/elastic/kibana/issues/109017
describe.skip('Welcome interstitial', () => {
describe('Welcome interstitial', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Going to kick off a flaky test runner job for this one. It passed locally.

Copy link
Member Author

Choose a reason for hiding this comment

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

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

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

[❌] x-pack/test/fleet_functional/config.ts: 89/100 tests passed.

see run history

@kpollich kpollich requested a review from a team as a code owner July 30, 2024 19:48
@kpollich
Copy link
Member Author

Another flaky test runner here. From the screenshots in the failed runs it looked like the welcome test hadn't fully faded in by the time the timeout was reached.

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

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

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

[✅] x-pack/test/fleet_functional/config.ts: 100/100 tests passed.

see run history

Comment on lines 61 to 62
await new Promise((resolve) => setTimeout(resolve, 1000));
return await this.testSubjects.isDisplayed('homeWelcomeInterstitial', 5000);
Copy link
Member

Choose a reason for hiding this comment

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

Not against the change, but if it is a page loading issue, you might need to update test with wait for global loading indicator to disappear:

      await PageObjects.common.navigateToUrl('home', undefined, { disableWelcomePrompt: false });
      await PageObjects.header.waitUntilLoadingHasFinished();
      expect(await PageObjects.home.isWelcomeInterstitialDisplayed()).to.be(true);

Sometimes it may take a while to finish loading the page.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for taking a look @dmlemeshko - I've reverted the timeout bump and pulled in the header loading check instead. Rerunning flaky test runner here: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6652

Copy link
Contributor

@criamico criamico left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

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

[✅] x-pack/test/fleet_functional/config.ts: 100/100 tests passed.

see run history

@kpollich
Copy link
Member Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

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

cc @kpollich

@kpollich kpollich merged commit 4b701de into elastic:main Jul 31, 2024
24 checks passed
@kpollich kpollich deleted the fleet/flaky-tests-20240730 branch July 31, 2024 18:14
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 31, 2024
## Summary

Closes elastic#184310
Closes elastic#180071
Closes elastic#109017

Fixes several flaky/failing tests that were qualified as 8.15.0
blockers.

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 4b701de)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 31, 2024
# Backport

This will backport the following commits from `main` to `8.15`:
- [[Fleet] Fix failing/flaky tests
(#189559)](#189559)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kyle
Pollich","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-31T18:14:30Z","message":"[Fleet]
Fix failing/flaky tests (#189559)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184310\r\nCloses
https://github.com/elastic/kibana/issues/180071\r\nCloses
https://github.com/elastic/kibana/issues/109017\r\n\r\nFixes several
flaky/failing tests that were qualified as
8.15.0\r\nblockers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<[email protected]>","sha":"4b701de03636bffe0e73a7d66ac589f27cb8530f","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d ).(\\d ).\\d $":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.15.0","v8.16.0"],"title":"[Fleet]
Fix failing/flaky tests
","number":189559,"url":"https://github.com/elastic/kibana/pull/189559","mergeCommit":{"message":"[Fleet]
Fix failing/flaky tests (#189559)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184310\r\nCloses
https://github.com/elastic/kibana/issues/180071\r\nCloses
https://github.com/elastic/kibana/issues/109017\r\n\r\nFixes several
flaky/failing tests that were qualified as
8.15.0\r\nblockers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<[email protected]>","sha":"4b701de03636bffe0e73a7d66ac589f27cb8530f"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d ).(\\d ).\\d $","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/189559","number":189559,"mergeCommit":{"message":"[Fleet]
Fix failing/flaky tests (#189559)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/184310\r\nCloses
https://github.com/elastic/kibana/issues/180071\r\nCloses
https://github.com/elastic/kibana/issues/109017\r\n\r\nFixes several
flaky/failing tests that were qualified as
8.15.0\r\nblockers.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic
Machine
<[email protected]>","sha":"4b701de03636bffe0e73a7d66ac589f27cb8530f"}}]}]
BACKPORT-->

Co-authored-by: Kyle Pollich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment