feat: add shareDriver, isReuseDriver hook, SPA navigation and headed mode to AbstractComponentIT#9255
Draft
manolo wants to merge 12 commits into
Draft
feat: add shareDriver, isReuseDriver hook, SPA navigation and headed mode to AbstractComponentIT#9255manolo wants to merge 12 commits into
manolo wants to merge 12 commits into
Conversation
c750284 to
e0b6dec
Compare
…igation Three independent opt-in features in AbstractComponentIT: test.reuseDriver (existing) - one Chrome window per test class. test.shareDriver (new) - one Chrome window for the entire JVM fork (implies reuseDriver). Health-check before reuse, debug-mode session persistence and reconnect, JVM shutdown hook for cleanup. test.useSpa (new) - SPA navigation via vaadin-navigate instead of full page load (requires reuseDriver or shareDriver). Falls back to full load on same route or non-Vaadin pages. test.headed (new) - headed Chrome instead of headless. isReuseDriver() hook - subclasses can opt out per class. Consecutive-failure abort after 5 failures in shareDriver mode. ci: use shareDriver to benchmark cross-class browser reuse in GHA
7a788ec to
c28f672
Compare
bfa7e25 to
32f0a4b
Compare
Tests that configure initial state via query parameters (e.g. initialSelection=0) were failing because trySpaNavigation received only getTestPath() without query params, causing the view to initialize without the required parameters. Pass the full relative URL including query string so the Vaadin router receives all parameters needed to set up the view's initial state.
SPA navigation reuses the Vaadin session, causing server-side events from previous tests to arrive in the current test. Tests with CLIENT:false value-change events or wrong initial state fail consistently. useSpa remains available as a local development flag only.
|
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.



Extends
AbstractComponentITwith four independent opt-in features, each enabled by a system property:-Dtest.reuseDriver=true(existing, unchanged behavior)One Chrome window per test class. Reuses the driver between methods, creates a new one per class.
-Dtest.shareDriver=true(new)One Chrome window for the entire JVM fork — reused across all test classes in the same process. Implies
test.reuseDriver. Includes a health-check before each class, debug-mode session persistence to disk for reconnect across runs, a JVM shutdown hook for cleanup, and a consecutive-failure abort rule (stops the fork after 5 consecutive failures to avoid burning CI time on a dead driver).-Dtest.useSpa=true(new)When combined with
reuseDriverorshareDriver, navigates between routes via the Vaadinvaadin-navigateclient event instead of a full page load. Falls back to a full load automatically when the browser is not on a Vaadin page or when navigating to the same route (which would leak session state).-Dtest.headed=true(new)Runs Chrome in headed (visible) mode. Default is headless. Also implied when a JDWP debug agent is attached.
isReuseDriver()hook (new)Allows subclasses to opt out of driver reuse on a per-class basis without changing the global system property. Returns
trueif eithertest.reuseDriverortest.shareDriveris active.Benchmark results (GHA, Ubuntu)
All runs use
forkCount=4unless noted. "Longest shard" is the wall-clock time of the slowest IT shard job.Key findings:
shareDrivervsreuseDriverwith 10 shards: ~11s difference — within noise, not significant. WithforkCount=4the Chrome startup cost is already amortized across 4 parallel forks.reuseDriver + SPAat 421s is the best 8-shard configuration.headed + reuseDriverreduces a 73s run to 16s for the same 29 tests.The CI in this PR uses
8 shards + reuseDriver + useSpaas a benchmark configuration.