Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to fix custom_threshold_preview_chart flaky test (#212028)
Fixes #209317 ## Summary Summary of [Slack](https://elastic.slack.com/archives/C04HT4P1YS3/p1740054800086779) discussion: As shown below, we check if the `Create rule` button exists and then we try to click it: ``` const clickCreateRuleButton = async () => { await testSubjects.existOrFail('createRuleButton'); const createRuleButton = await testSubjects.find('createRuleButton'); return await createRuleButton.click(); }; ``` It seems something goes wrong during click in this case and even after 2 mins, we don't see the modal: ``` [00:03:11] │ debg --- retry.tryForTime error: [data-test-subj="ruleTypeModal"] is not displayed ... [00:05:09] └- ✖ fail: ObservabilityApp Custom threshold preview chart does render the empty chart only once at bootstrap ``` @dmlemeshko pointed to the implementation that we have for the button and the fact that we need to first check if the user is authorized to see this button, and something might have caused the click not to be successful even though there is no error reported by WebDriver. ``` useEffect(() => { setHeaderActions?.([ ...(authorizedToCreateAnyRules ? [<CreateRuleButton openFlyout={openRuleTypeModal} />] : []), <RulesSettingsLink />, <RulesListDocLink />, ]); }, [authorizedToCreateAnyRules]); ``` Long story short, we will add waiting for the global spinner to hopefully make this test less flaky 🤞🏻 --------- Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
- Loading branch information