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

[Cloud Security][FTR][Bug] Add a little delay for findings FTR for stability #160696

Merged
merged 9 commits into from
Jul 14, 2023

Conversation

animehart
Copy link
Contributor

@animehart animehart commented Jun 28, 2023

Summary

  • added 1s delay between adding a filter and checking the filter
  • added 1s delay to allow both Kubernetes and Cloud tab to render on Dashboard page

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

Copy link
Contributor

@kfirpeled kfirpeled left a comment

Choose a reason for hiding this comment

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

@animehart increasing the sleep from 1s to 3s points to me that we are going in the wrong direction with that workaround.

We should be able to detect better when a sort action is over

@animehart
Copy link
Contributor Author

@kfirpeled
I revert the 3s changes i made on my last PR as I realized adding delay on that line don't really fix anything, current fix is tested on Flaky test run for over 1000 cycles with 0 failures

@@ -63,6 +64,7 @@ export function CspDashboardPageProvider({ getService, getPageObjects }: FtrProv

getKubernetesTab: async () => {
const tabs = await dashboard.getDashboardTabs();
sleep(1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of placing a sleep here we should check if we can wait for the tabs to appear with a timeout of 1s or 2s

@@ -131,6 +131,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
describe('SearchBar', () => {
it('add filter', async () => {
await filterBar.addFilter({ field: 'rule.name', operation: 'is', value: ruleName1 });
sleep(1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of the following sleep we should call HeaderPageObject.awaitGlobalLoadingIndicatorHidden on before test

@kfirpeled
Copy link
Contributor

kfirpeled commented Jul 11, 2023

When we went over the PR together we saw that we can have a reference to the header page object by calling

this.header = getPageObject('header')

in the DashboardPage. And later we can wait for the loading page to finish using awaitGlobalLoadingIndicatorHidden or waitUntilLoadingHasFinished

export function CspDashboardPageProvider({ getService, getPageObjects }: FtrProviderContext) {
  const PageObjects = getPageObjects(['common', 'header']);

// MORE CODE HERE ...

// PSEUDO USAGE:

    getDashboardTabs: async () => {
      // Waits for the page to load
      await PageObjects.header. awaitGlobalLoadingIndicatorHidden();
      // REST OF THE LOGIC
    },

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 409 413 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 488 492 +4
total +6

History

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

@animehart
Copy link
Contributor Author

Screenshot 2023-07-11 at 8 27 37 PM tested on flaky test runner for 1110 cycles with 0 failures

@animehart animehart requested a review from kfirpeled July 12, 2023 04:30
Copy link
Contributor

@kfirpeled kfirpeled left a comment

Choose a reason for hiding this comment

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

LGTM

@animehart animehart merged commit e9a0ad1 into elastic:main Jul 14, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment