[
https://issues.apache.org/jira/browse/SLING-12415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17882346#comment-17882346
]
Stefan Seifert commented on SLING-12415:
----------------------------------------
here is a way to experiment with different timeout values using the new
configuration option introduced with SLING-12435:
to increase the timeout, set the system property
{{sling.mock.resourceresolverfactoryactivator.timeout.ms}} to a value higher
than 250 (the default value of 250ms).
to apply it to any build regardless of the CI in your project, create a file
{{.mvn/maven.config}} in the toplevel directory of your project with the
content:
{noformat}
-Dsling.mock.resourceresolverfactoryactivator.timeout.ms=100
{noformat}
then include in the dependencyManagement section of the project temporarily:
{code:xml}
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.sling-mock.core</artifactId>
<version>3.5.3-SNAPSHOT</version>
</dependency>
{code}
and to make sure this snapshot can be loaded include temporarily:
{code:xml}
<repositories>
<repository>
<id>apache-snapshots</id>
<url>https://repository.apache.org/snapshots</url>
<layout>default</layout>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
{code}
> Intermittent build failures on Sling Test envs -
> ResourceResolverFactoryActivator 250 ms
> ----------------------------------------------------------------------------------------
>
> Key: SLING-12415
> URL: https://issues.apache.org/jira/browse/SLING-12415
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Reporter: Niek Raaijmakers
> Priority: Major
>
> SLING-12090 introduced some cases where unit tests failed intermittently:
> We see:
>
> {code:java}
> 09:01:47,710 [ThreadedStreamConsumer] [ERROR] Tests run: 2, Failures: 0,
> Errors: 1, Skipped: 0, Time elapsed: 2.016 s <<< FAILURE! - in
> com.x.y.z.MoreLandingPagesServletTest 09:01:47,710 [ThreadedStreamConsumer]
> [ERROR] testDoGetLandingPagesServlet Time elapsed: 0.012 s <<< ERROR!
> java.lang.RuntimeException: Unable to initialize JCR_MOCK resource resolver
> factory: ResourceResolverFactoryActivator did not register a
> ResourceResolverFactory after 250ms. Caused by:
> java.lang.IllegalStateException: ResourceResolverFactoryActivator did not
> register a ResourceResolverFactory after 250ms.{code}
>
> Perhaps we could increase the timeout?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)