feat: delegate waitForVaadin readiness checks to Flow#2160
Draft
Artur- wants to merge 2 commits into
Draft
Conversation
2c0976c to
6cfbe71
Compare
Test Results246 tests 242 ✅ 14m 30s ⏱️ For more details on these failures and errors, see this check. Results for commit e389e12. ♻️ This comment has been updated with latest results. |
mcollovati
reviewed
Apr 20, 2026
Comment on lines
+64
to
+65
| getCommandExecutor() | ||
| .executeScript("window.Vaadin.Flow.whenReady = false;"); |
Contributor
There was a problem hiding this comment.
With this setting the test always fails because waitForVaadin almost immediately returns, since there's nothing waiting for the timeout expected by assertExecutionBlocked
b8748ef to
17f911b
Compare
TestBench used to reimplement Flow's "am I idle?" logic in an inline
JS poll loop that checked document.readyState, devServerIsNotLoaded,
and iterated Flow.clients for isActive(). Flow now exposes that as a
canonical Promise API (window.Vaadin.Flow.ready), so use it instead
and let Flow own the readiness model. Keeps TestBench in sync as
Flow's bootstrap evolves and removes a parallel implementation that
could drift.
waitForVaadin runs in two phases: a short Java-side poll for the
ready function to be defined (survives dev server page reloads),
then a single executeAsyncScript that calls Flow.ready({ timeout })
with the remaining budget. Both fulfilment and rejection resolve to
the same callback so a JS-side timeout still releases the script.
The waitForVaadinLoopHook reflection seam is gone; integration tests
now drive readiness from JS (setTimeout flipping Flow.ready) and use
Flow.ready = false as the not-ready sentinel, matching the dev-mode
loading page. Drops waitForVaadin_noFlow_returnsImmediately since
Flow is now required to be loaded.
17f911b to
e389e12
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.
Replace the synchronous polling script that checked document.readyState,
devServerIsNotLoaded, and active clients directly with a call to
Flow's whenReady callback, which now owns all readiness logic.
TestBench polls Java-side until whenReady is a function (handling dev
server startup where the page may not have Flow loaded yet), then
makes a single executeAsyncScript call to let Flow report readiness.
Remove the waitForVaadinLoopHook testing mechanism and update
integration tests to use whenReady=false and setTimeout instead.