Skip to content

chore: stabilizing DefaultSupervisingRouteControllerTest#16007

Merged
davsclaus merged 1 commit intoapache:mainfrom
apupier:investigateDefaultSupervisingRouteControllerTestDifferentFlakinessWithNull
Oct 19, 2024
Merged

chore: stabilizing DefaultSupervisingRouteControllerTest#16007
davsclaus merged 1 commit intoapache:mainfrom
apupier:investigateDefaultSupervisingRouteControllerTestDifferentFlakinessWithNull

Conversation

@apupier
Copy link
Contributor

@apupier apupier commented Oct 18, 2024

Previous improvement of assertion was when the list of failure was not arriving always in the same order. But the test is still flaky, there are 2 reasons:

  • the exception was not set yet as all retries were not finished
  • the lists used in test to collect events and failures were not synchronized and can be called in different threads. It seems that it was causing some elements to not be added correctly. I suspected a caught ConcurrentModificationException but in debug mode it is not hit. So not sure the root reason using syncehonizedList seems to do the trick.
    Using @RepeatedTest locally, I had between 5 and 15 tests in error on 50 attempts before. Now I hit 100% success.

Description

last falky failure on Ci https://ci-builds.apache.org/job/Camel/job/Camel%20Core%20(Build%20and%20test)/job/main/lastCompletedBuild/testReport/org.apache.camel.impl.engine/DefaultSupervisingRouteControllerTest/BuildAndTest___Matrix___JDK_NAME____jdk_21_latest___PLATFORM____ubuntu_avx____Test___testSupervising/

org.opentest4j.AssertionFailedError: expected: not <null>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49)
	at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35)
	at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:30)
	at org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:304)
	at org.apache.camel.impl.engine.DefaultSupervisingRouteControllerTest.testSupervising(DefaultSupervisingRouteControllerTest.java:98)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

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.

Previous improvement of assertion was when the list of failure was not
arriving always in the same order. But the test is still flaky, there
are 2 reasons:
* the exception was not set yet as all retries were not finished
* the lists used in test to collect events and failures were not
synchronized and can be called in different threads. It seems that it
was causing some elements to not be added correctly. I suspected a
caught ConcurrentModificationException but in debug mode it is not hit.
So not sure the root reason using syncehonizedList seems to do the
trick.
Using @RepeatedTest locally, I had between 5 and 15 tests in error on 50
attempts before. Now I hit 100% success.

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

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@davsclaus davsclaus merged commit 094fe6c into apache:main Oct 19, 2024
@apupier apupier deleted the investigateDefaultSupervisingRouteControllerTestDifferentFlakinessWithNull branch October 19, 2024 08:05
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.

2 participants