-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Camel 20291] Fixed many unit tests that failed due to threading issues; disabled the remaining broken unit tests. #12739
Conversation
…ted reuseForks property to default to 'false'
…sts are failing and whether or not they are even useful
…emoved parallel execution from JMS tests
🌟 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:
|
Jira tickets will be created for each module with broken unit tests so that they can be addressed individually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mass-disabling tests is the incorrect approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of the reported ones are not failing for me. Also I do believe disabling them at all doesn't help. In the end we'll forget to fix them and we won't notice regressions, if any. So -1 for me.
I have already created Jira tickets for every module with failing tests, so I don't believe that the failures will be forgotten. I disagree that disabling the tests is the wrong approach. I inquired about broken tests many weeks ago and was told this is a "known" problem, but nobody has been working to fix them. In my opinion, broken unit tests are worse than no tests at all. Also, many of the tests pass when building a single module, but they fail when building all of Camel at once. This requires a lot of investigation to determine the source of the problems, which is why I created Jira tickets for each broken module. Finally, many of the tests are integration tests, not unit tests, and simply should not be run at all by |
There are multiple reasons to not merge this PR: the main one is disabling reuseForks. This will slow down the build on CI and the test won't run quick. This is a great limitation, as our source of truth is the CI build on Jenkins and GH action (with some flaky tests). You have your point of view at that's fine, but disabling everything and removing reuseFork is not what we expect to do. Running a full build locally with around 25k tests is time consuming and except particular scenario, doesn't make sense for local development. That's the reason why is -1 for me. We can focus on fixing the tests or improving the build, but not at the cost of slowing down tests. |
Many tests fail due to threading issues that are related to setting |
-1 from me as well. |
Our tests are not perfect. We know that we (I, in particular) have been fixing them for quite a while. That said, to say that they are "broken" is a very big stretch.
And, although we do have occasional failures, the incidence is very small. So, what can be done to improve the reliability of the tests? Look for flaky tests using the dashboard from The ASF Develocity environment. When finding a problem on a test, focus on the source of the problem: if there is a threading problem, try to reproduce it, provide traces and dumps for the community so we can fix or assist with the fix/review (it's very likely the fix will require internal knowledge of the core code). |
My recommended approach is trusting the CI build. |
Description
When running
mvn install
ormvn test
, many Camel unit tests fail that are based onContextTestSupport
. These failures are due to threading issues that rarely occur when testing individual modules.CamelTestSupport
, which is used for testing classes outside of Camel Core, usesThreadLocal
instances for theCamelContext
, theProducerTemplate
, and theConsumerTemplate
.ContextTestSupport
was updated to useThreadLocal
as well. In addition, the propertycamel.surefire.reuseForks
inparent/pom.xml
now defaults to false. Flaky unit tests were disabled along with unit tests that require Docker. Parallel execution of JMS tests was also disabled.Target
camel-3.x
, whereas Camel 4 uses themain
branch)Tracking
Apache Camel coding standards and style
[ X] I checked that each commit in the pull request has a meaningful subject line and body.
[ X] I have run
mvn clean install -DskipTests
locally and I have committed all auto-generated changes