In Vaadin 25.2.8, the tests were really, really fast—it was actually great.
The problem in version 25.3.1 is that, according to the Surfire report, the ClassGraph remains in the BLOCKED state
Setup
Vaadin 25.3.1, Spring Boot 4.1.1, Java 25 (Corretto 25.0.4.1)
browserless-test-spring, plus com.vaadin:vaadin-dev in the POM (optional)
About 37 test classes create their environment with BrowserlessUIContext.forComponent(...) in @BeforeEach and close it in @AfterEach (no Spring base class for those)
No @ViewPackages anywhere
What I found
Surefire wrote a thread dump when I cancelled the run (in target/surefire-reports/*.dump). The main thread is inside a full ClassGraph scan started by Copilot:
at com.vaadin.copilot.shaded.classgraph.ClassGraph.scan(ClassGraph.java:1609)
at com.vaadin.copilot.CopilotDebugViewRegistrar.registerDebugViews(CopilotDebugViewRegistrar.java:58)
at com.vaadin.copilot.CopilotIndexHtmlLoader.serviceInit(CopilotIndexHtmlLoader.java:51)
at com.vaadin.flow.server.VaadinService.init(VaadinService.java:279)
at com.vaadin.browserless.mocks.MockVaadinServlet.createServletService(MockVaadinServlet.kt:45)
at com.vaadin.flow.server.VaadinServlet.init(VaadinServlet.java:134)
at com.vaadin.browserless.internal.MockVaadin.setupServlet(MockVaadin.kt:187)
at com.vaadin.browserless.BrowserlessApplicationContext$Builder.buildService(BrowserlessApplicationContext.java:732)
at com.vaadin.browserless.BrowserlessApplicationContext.create(BrowserlessApplicationContext.java:140)
at com.vaadin.browserless.BrowserlessApplicationContext.forComponent(BrowserlessApplicationContext.java:204)
at com.vaadin.browserless.BrowserlessUIContext.forComponent(BrowserlessUIContext.java:268)
at <my test>.mount(...)
Thanks for reporting this. This is an unexpected side effect of an experimental feature in Copilot.
Copilot scans the class path on initialization to collect some information about the project and it is done in VaadinServiceInitListener. Therefore, any time VaadinServlet#init is called, scanning is executed, which causes the slowness.
We are working on a fix. Meanwhile, you can disable the Copilot in test suites via CopilotStatus.setHiddenByUser(true) or setting the system property vaadin.copilot.enable=false
A workaround is to have the test code wrapped into a try/finally block and setting/removing the vaadin.copilot.enable system property (e.g. System.setProperty())
By default it would be dev mode yes, and now I think that enabling production mode in Browserless configuration probably would not override built time dev token.
So a cleaner option that you can use if you want to keep the pom unmodified is to disable copilot for browserless tests only using