Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.20.0 regression: TestEngine with ID 'cucumber' failed to discover tests #2930

Closed
murdos opened this issue Oct 5, 2024 · 2 comments · Fixed by #2931
Closed

7.20.0 regression: TestEngine with ID 'cucumber' failed to discover tests #2930

murdos opened this issue Oct 5, 2024 · 2 comments · Fixed by #2931

Comments

@murdos
Copy link

murdos commented Oct 5, 2024

👓 What did you see?

Build of PR opened by renovate with new Cucumber version is failing: jhipster/jhipster-lite#11057:

Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.0:test (default-test) on project jhlite:
Error:
Error: Please refer to /home/runner/work/jhipster-lite/jhipster-lite/target/surefire-reports for the individual test results.
Error: Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
Error: [ERROR] There was an error in the forked process
Error: TestEngine with ID 'cucumber' failed to discover tests
Error: org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Error: TestEngine with ID 'cucumber' failed to discover tests
Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:628)
Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285)
Error: at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250)
Error: at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1337)
Error: at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1137)
Error: at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:971)
Error: at com.gradle.maven.cache.extension.d.c.a(SourceFile:27)

✅ What did you expect to see?

Build running fine, as it was with 7.19.0

📦 Which tool/library version are you using?

cucumber-junit-platform-engine
cucumber-spring
maven-failsafe-plugin
gradle-develocity

🔬 How could we reproduce it?

No response

📚 Any additional context?

Our cucumbers tests are executed with maven-failsafe-plugin, but here the error happens with the execution of maven-surefire-plugin

@mpkorstanje
Copy link
Contributor

$ cat jhipster/jhipster-lite/target/surefire-reports/2024-10-05T16-15-25_011-jvmRun1.dump
# Created at 2024-10-05T16:15:26.116
org.junit.platform.commons.JUnitException: TestEngine with ID 'cucumber' failed to discover tests
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
	at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:77)
	at org.junit.platform.launcher.core.DelegatingLauncher.discover(DelegatingLauncher.java:42)
	at org.apache.maven.surefire.junitplatform.LazyLauncher.discover(LazyLauncher.java:50)
	at org.apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:52)
	at org.apache.maven.surefire.api.util.DefaultScanResult.applyFilter(DefaultScanResult.java:87)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:142)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: java.util.ServiceConfigurationError: io.cucumber.core.eventbus.UuidGenerator: Provider io.cucumber.core.eventbus.IncrementingUuidGenerator could not be instantiated
	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586)
	at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
	at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
	at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
	at io.cucumber.core.runtime.UuidGeneratorServiceLoader.loadSingleUuidGeneratorOrDefault(UuidGeneratorServiceLoader.java:60)
	at io.cucumber.core.runtime.UuidGeneratorServiceLoader.loadUuidGenerator(UuidGeneratorServiceLoader.java:46)
	at io.cucumber.junit.platform.engine.FeatureResolver.createFeatureParser(FeatureResolver.java:69)
	at io.cucumber.junit.platform.engine.FeatureResolver.<init>(FeatureResolver.java:59)
	at io.cucumber.junit.platform.engine.FeatureResolver.create(FeatureResolver.java:78)
	at io.cucumber.junit.platform.engine.DiscoverySelectorResolver.resolve(DiscoverySelectorResolver.java:67)
	at io.cucumber.junit.platform.engine.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:53)
	at io.cucumber.junit.platform.engine.CucumberTestEngine.discover(CucumberTestEngine.java:47)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
	... 15 more
Caused by: io.cucumber.core.exception.CucumberException: Out of IncrementingUuidGenerator capacity. Please reuse existing instances or use another UuidGenerator implementation instead.
	at io.cucumber.core.eventbus.IncrementingUuidGenerator.<init>(IncrementingUuidGenerator.java:102)
	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
	... 26 more

mpkorstanje added a commit that referenced this issue Oct 5, 2024
Even when not used, the `IncrementingUuidGenerator` is instantiated with
each Cucumber execution. This somewhat fundamental to the way the
`ServiceLoader` mechanism works.

Each time an incrementing generator is created, a new session is started
for that generator. This means that after 255 executions all sessions
are exhausted.

Unfortunately, when using the JUnit Platform, Maven issues a discovery
request for each individual class. And Cucumber typically participates
in discovery along with JUnit Jupiter. So after 255 classes, Cucumber
fails discovery as seen in #2930.

Fixes #2930.
mpkorstanje added a commit that referenced this issue Oct 5, 2024
Even when not used, the `IncrementingUuidGenerator` is instantiated with
each Cucumber execution. This somewhat fundamental to the way the
`ServiceLoader` mechanism works.

Each time an incrementing generator is created, a new session is started
for that generator. This means that after 255 executions all sessions
are exhausted.

Unfortunately, when using the JUnit Platform, Maven issues a discovery
request for each individual class. And Cucumber typically participates
in discovery along with JUnit Jupiter. So after 255 classes, Cucumber
fails discovery as seen in #2930.

Fixes #2930.
@mpkorstanje
Copy link
Contributor

Cheers. Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants