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

Disocvery caching is defeated by Surefire #1325

Closed
greenbird-chr opened this issue Mar 30, 2020 · 0 comments · Fixed by #1326
Closed

Disocvery caching is defeated by Surefire #1325

greenbird-chr opened this issue Mar 30, 2020 · 0 comments · Fixed by #1326

Comments

@greenbird-chr
Copy link
Contributor

When building with Kotest 4.0.1 and Maven surefire 2.2.2 Discovery.discover is called once per spec class identified by Surefire.

I noticed that my Kotest initialization time increased linearly by number of specs.

This is caused by Discovery.discover performing a full scan of the classpath for each single spec:

...
Test discovery competed in 669ms
Scan discovered 50 classes in the classpaths...
After filters there are 1 spec classes
classSelectors=[com.greenbird.metercloud.integration.flowserver.systemtest.flow.http.RestSourceValidationSpec]
...
Test discovery competed in 794ms
Scan discovered 50 classes in the classpaths...
After filters there are 1 spec classes
After discovery extensions there are 1 spec classes
classSelectors=[com.greenbird.metercloud.integration.flowserver.systemtest.flow.http.HttpReverseProxyErrorHandlingSpec]
...
Test discovery competed in 657ms
Scan discovered 50 classes in the classpaths...
After filters there are 1 spec classes
classSelectors=[com.greenbird.metercloud.integration.flowserver.systemtest.flow.http.SoapEchoSpec]
...

Discovery is caching on DiscoveryRequest but this does not help as each request is unique.

This can be fixed by also caching the result of scanUris.

greenbird-chr added a commit to greenbird-chr/kotest that referenced this issue Mar 30, 2020
greenbird-chr added a commit to greenbird-chr/kotest that referenced this issue Mar 30, 2020
greenbird-chr added a commit to greenbird-chr/kotest that referenced this issue Mar 31, 2020
sksamuel pushed a commit that referenced this issue Apr 2, 2020
* Caching result of scanUris (#1325)

* Optimizing Spec loading for single class selections (#1325)
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.

1 participant