Skip to content

Configure test container Solr with several startup attempt#15271

Merged
apupier merged 1 commit into
apache:mainfrom
apupier:retryWithAttemptsForSolrTestContainer
Aug 22, 2024
Merged

Configure test container Solr with several startup attempt#15271
apupier merged 1 commit into
apache:mainfrom
apupier:retryWithAttemptsForSolrTestContainer

Conversation

@apupier
Copy link
Copy Markdown
Contributor

@apupier apupier commented Aug 22, 2024

to stabilize build on CI

Description

it shoudl avoid this kind of errors:

[ERROR] org.apache.camel.component.solr.integration.SolrCloudProducerIT -- Time elapsed: 93.50 s <<< ERROR!
org.testcontainers.containers.ContainerLaunchException: Container startup failed for image solr:9.6.1
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
	at org.apache.camel.test.infra.solr.services.SolrLocalContainerService.initialize(SolrLocalContainerService.java:41)
	at org.apache.camel.test.infra.common.services.TestServiceUtil.tryInitialize(TestServiceUtil.java:43)
	at org.apache.camel.test.infra.solr.services.SolrService.beforeAll(SolrService.java:36)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
	... 5 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:563)
	at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
	at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
	... 6 more
Caused by: java.lang.IllegalStateException: Wait strategy failed. Container exited with code 1
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:533)
	... 8 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Server.*Started.*'
	at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
	at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
	at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:909)
	at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:500)
	... 8 more

Target

  • I checked that the commit is targeting the correct branch (note that Camel 3 uses camel-3.x, whereas Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

to stabilize build on CI

Signed-off-by: Aurélien Pupier <apupier@redhat.com>
@apupier
Copy link
Copy Markdown
Contributor Author

apupier commented Aug 22, 2024

/component-test solr

Result ✅ The tests passed successfully

@github-actions
Copy link
Copy Markdown
Contributor

🤖 The Apache Camel test robot will run the tests for you 👍

@apupier
Copy link
Copy Markdown
Contributor Author

apupier commented Aug 22, 2024

unrelated uncommited changes to this PR:

diff --git a/components/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringStreamCachingStrategyTest.java b/components/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringStreamCachingStrategyTest.java
index 40ba7eb6..44534e9c 100644
--- a/components/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringStreamCachingStrategyTest.java
+++ b/components/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringStreamCachingStrategyTest.java
@@ -40,7 +40,8 @@ public class SpringStreamCachingStrategyTest extends SpringTestSupport {
         assertTrue(context.getStreamCachingStrategy().isEnabled());
         assertEquals(normalizePath("target/cachedir"),
                 normalizePath(context.getStreamCachingStrategy().getSpoolDirectory().toString()));
-        assertEquals(Integer.valueOf(IOHelper.DEFAULT_BUFFER_SIZE).intValue(), context.getStreamCachingStrategy().getBufferSize());
+        assertEquals(Integer.valueOf(IOHelper.DEFAULT_BUFFER_SIZE).intValue(),
+                context.getStreamCachingStrategy().getBufferSize());
         assertEquals(Long.valueOf(8192).longValue(), context.getStreamCachingStrategy().getSpoolThreshold());
         assertEquals("java.io.ByteArrayInputStream",
                 context.getStreamCachingStrategy().getAllowClasses().iterator().next().getName());

will be fixed with #15275

@apupier apupier merged commit c537d4c into apache:main Aug 22, 2024
@apupier apupier deleted the retryWithAttemptsForSolrTestContainer branch May 26, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants