[test] Add stabilization waits to Add Cluster webview - #6039
Open
vrubezhny wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6039 +/- ##
===========================================
+ Coverage 32.37% 50.61% +18.23%
===========================================
Files 85 114 +29
Lines 6505 10389 +3884
Branches 1349 2334 +985
===========================================
+ Hits 2106 5258 +3152
- Misses 4399 5128 +729
- Partials 0 3 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vrubezhny
force-pushed
the
tests/add-cluster-stabilization
branch
15 times, most recently
from
August 17, 2026 01:27
e990884 to
b495cf5
Compare
…utton/input finders Move the sparse-polling helper (upfront sleep, then infrequent checks instead of tight driver.wait() polling) into the shared WebViewForm base class as findElementSparse(), so all webview page objects can use it. Apply it to: - AddClusterWebView (previously had its own private copy of the same helper) - ServerlessFunctionWebViewEditor: all input/button getters, replacing plain findWebElement() calls that had no retry safety net at all - CreateComponentWebView / GitProjectPage / LocalCodeBasePage: button getters, including refactoring createComponentFromTemplate/FromGit/FromLocalCodebase away from re-entering the webview frame (switchToFrame/switchBack) on every poll iteration, which is more expensive per-iteration than a plain element query and was the most aggressive form of the tight-loop pattern in the suite A tight polling loop re-runs an XPath query on the webview's single JS thread every ~200ms, competing with the page's own async rendering (Material-UI) for that same thread instead of just waiting for it. Sparse checks give the page real idle stretches to finish rendering. findElementSparse() tries immediately first before sleeping, so sequential lookups on an already-rendered page (e.g. filling in one form field after another) pay no extra latency - only a lookup that doesn't find its element right away falls into the sleep-then-poll cycle. Widen AddClusterWebView button-finding timeout to 35s and fix two "Add Cluster" tests that had no explicit mocha timeout (falling back to the 7s global default, too short for a page that can take much longer to render under CI load). Also add chai expect() assertions with descriptive error messages in AddClusterWebView and CreateComponentWebView to pinpoint exact failures. Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com> Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
vrubezhny
force-pushed
the
tests/add-cluster-stabilization
branch
from
August 17, 2026 02:13
b495cf5 to
4217d84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix intermittent public UI test failures for Material-UI-based webviews (Add Cluster, Create Component, Serverless Function) by replacing tight-loop DOM polling with sparse checks.
Background
These failures were first noticed after the survey 3.0.0 bump, but none of the affected webviews (Add Cluster, Create Component, Serverless Function) actually use the
surveypackage - only the feedback webview does. The real issue is generic: async Material-UI rendering combined with how the tests were polling for elements.Root cause
A tight
driver.wait()loop re-runs an XPath query on the webview's single JS thread every ~200ms. This can compete with the page's own async rendering work for that same thread instead of just waiting for it - potentially delaying the very rendering the loop is waiting for. One test file (newComponentWebViewEditor.ts) went further and re-entered the webview frame (switchToFrame/switchBack) on every poll iteration, which is even more expensive per cycle.Separately, CI runner contention (three OS runners plus other PRs running in parallel) appears to compound the slowness - the same test code was observed to pass reliably when re-run in isolation.
Changes
findElementSparse()helper to theWebViewFormbase class: tries immediately first (so already-rendered pages pay no extra latency), then falls back to sleeping upfront and checking infrequently instead of tight-looping.AddClusterWebView,ServerlessFunctionWebViewEditor, andCreateComponentWebView/GitProjectPage/LocalCodeBasePagewith this helper.createComponentFromTemplate/FromGit/FromLocalCodebaseto enter the webview frame once instead of re-entering it on every poll iteration.expect()assertions to pinpoint exact failures instead of generic timeouts.addServiceBinding.tsandcreateServiceWebView.tsuse the same tight-loop pattern but haven't shown failures - left as-is for now since they're subject to unrelated upcoming changes.