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

CAMEL-19400: camel-elasticsearch - Use nested classes to speed up #10234

Closed
wants to merge 2 commits into from

Conversation

essobedo
Copy link
Contributor

Fixes https://issues.apache.org/jira/browse/CAMEL-19400

Motivation

The build on Jenkins takes between 7h and 8h which is much too long especially when we know that the max duration allowed is about 9 h.

So the idea of these changes is to reduce the duration of the integration tests of the elasticsearch component by merging all the integration tests into a single integration test class. The all integration test classes are converted into nested classes, this way testcontainers only starts a docker container of ES once for all instead of once for each integration test class.

Modifications:

  • Changes the behavior of camel-test-infra-common to only initialize and shutdown when it is called for outer classes
  • Converts all integration test classes into nested classes of the same outer class

Result:

In my local machine, with the old approach, the tests take about 200 seconds while it now takes about 40 seconds.

@essobedo essobedo requested a review from orpiske May 29, 2023 17:20
@github-actions
Copy link
Contributor

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

🐫 Maintainers, please note that first-time contributors require manual approval for the GitHub Actions to run.

⚠️ Please note that the changes on this PR may be tested automatically if they change components.

If necessary Apache Camel Committers may access logs and test results in the job summaries!

@essobedo
Copy link
Contributor Author

@orpiske as you are the code owner of the test-infra components, what do you think of this approach?

@github-actions
Copy link
Contributor

Components tested:

Total Tested Failed ❌ Passed ✅
1 1 0 1

@orpiske
Copy link
Contributor

orpiske commented May 30, 2023

@orpiske as you are the code owner of the test-infra components, what do you think of this approach?

That's an interesting approach and I am OK with it.

I am curious about something, though: have you tried implementing JUnit-based singleton services for Elasticsearch? This approach uses JUnit's context extension store to retain the instance between test executions.
We do that for Kafka and it seems to improve the test times too (except for a few scenarios where we need to break stuff / or need broken stuff).

@essobedo
Copy link
Contributor Author

@orpiske I was not aware of this approach, thx for sharing, let me use the same approach for ES to remain homogenous.

@essobedo essobedo closed this May 30, 2023
@essobedo essobedo deleted the CAMEL-19400/reduce-it-duration branch May 30, 2023 07:42
@essobedo
Copy link
Contributor Author

essobedo commented Jun 1, 2023

The follow up PR #10252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants