-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Testcontainers Elasticsearch does not work #37672
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
Comments
I think the issue is related to Elasticsearch 8. See #35926 and the examples in the description can be useful to fix your issue |
But it seems something was changed in Spring Boot 3.2, I followed the sample project (Spring Boot 3.1.4) in your link https://github.com/eddumelendez/testcontainers-samples/blob/main/spring-boot-elasticsearch have added tests for ES 7 and ES 8, both failed. |
To be more specific it works with spring boot 3.2.0-M2 and start failing with 3.2.0-M3. However, if |
Thanks the the analysis @eddumelendez. In addition to isolating the change to Spring Data Elasticsearch, the tests are failing on an assertion that is attempting to verify the state of an object after it has been saved to a repository. Since the repository and the container have been created as expected by this point in the test, I don't think this has anything to do Boot's auto-configuration or Testcontainers integration. I debugged through the flow far enough to see that calls are being made to create the ID when saving the entity, but the generated ID is not getting copied back into the If you want to get further, I would suggest refining the sample to configure Spring Data Elasticsearch without Boot auto-configuration as suggested in the earlier issue and create a new issue in Spring Data Elasticsearch. |
@scottfrederick But Spring Data guys think this is a Spring Boot autoconfiguration issue, check spring-projects/spring-data-elasticsearch#2709 |
@hantsy The same advice is being given in two issues now. Since it appears you've been able to reproduce the problem using manual Spring Data Elasticsearch configuration without Spring Boot auto-configuration involved, let's keep the discussion in the Spring Data Elasticsearch issue please. |
The original post is created on Spring Data Elasticsearch issue: spring-projects/spring-data-elasticsearch#2709 (comment)
But it seems like a Spring Boot testcontainers autoconfiguration issue, the following example project was working in Spring 3.1. Now it is updated to Spring Boot 3.2-M3, Java 21, and Elasticsearch 8, it test failed.
The sample project is https://github.com/spring-projects/spring-data-elasticsearch/files/12793105/boot-data-elasticsearch.zip
The text was updated successfully, but these errors were encountered: