Open federicoorlandini opened 2 weeks ago
Hey @federicoorlandini
It's hard to read the code the way it's been formatted. Is there a repository we can look at to see the code?
Hi @w1am , I fixed the text formatting for the code in my initial message. I hope that it is now more readable.
Looking forward to reading your thoughts about the issue I presented.
Thank you.
This might be caused by lingering connections from the previous container. I would make sure to close the client before stopping the container.
Perhaps something like this:
@AfterEach
public void afterEach() {
if (projectionClient != null) {
projectionClient.shutdown().get();
}
if (eventStoreDbClient != null) {
eventStoreDbClient.shutdown().get();
}
eventStoreDbContainer.stop();
}
We do the same in our tests. See ClientTracker.java
Hi William,
thank you for your suggestion. Unfortunately, the issue persists even after adding the call to the shutdown() method as you suggested. Since the issue persists and I didn't find any other information/suggestion, I'm going to drop EventStoreDB as event store database and I'll migrate to PostgreSQL.
Thank you for the help.
Best regards, Federico
Il giorno lun 7 ott 2024 alle ore 08:58 William Chong < @.***> ha scritto:
This might be caused by lingering connections from the previous container. I would make sure to close the client before stopping the container.
Perhaps something like this:
@AfterEach public void afterEach() { if (projectionClient != null) { projectionClient.shutdown(); } if (eventStoreDbClient != null) { eventStoreDbClient.shutdown(); } eventStoreDbContainer.stop(); }
— Reply to this email directly, view it on GitHub https://github.com/EventStore/EventStoreDB-Client-Java/issues/287#issuecomment-2396067559, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMSCQEFIZMWRNJWRERMBG3Z2IWJZAVCNFSM6AAAAABPDZOJ32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJWGA3DONJVHE . You are receiving this because you were mentioned.Message ID: @.***>
Hi here,
not sure if this is the right place to raise my question. Anyway, I'm using TestContainers to spin Docker containers to run integration tests using EvenStore database. Every integration test scenario spins a new container. This is the test class that contains the tests:
This class inherits from this one:
And this is the ProjectionRepository class that implements the EnsureProjectExists() method:
When executing the Gradle build, the first call to the method projectionRepository.EnsureProjectionExists() works, it returns the list of the projections and the test pass, but when Gradle executes the other test case and it executed the second time the projectionRepository.EnsureProjectionExists() then the execution stucks and I after the timeout the test fails with the error:
java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 29.999275400s. Name resolution delay 0.000000000 seconds. [closed=[], open=[[remote_addr=localhost/127.0.0.1:63215]]] at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) at com.federico.LessonBookingSystem.adapters.out.persistence.EventStoreLessonProjectionsRepository.ProjectionExists(EventStoreLessonProjectionsRepository.java:61) at com.federico.LessonBookingSystem.adapters.out.persistence.EventStoreLessonProjectionsRepository.EnsureProjectionExists(EventStoreLessonProjectionsRepository.java:31) at integration.EventStoreLessonProjectionsRepositoryTests.GetLessonOverviewUseCase_createOneLesson_eventModellingScenario3(EventStoreLessonProjectionsRepositoryTests.java:124)
For a reason that I'm not getting, the second call to the projectionClient.list().get() (see ProjectionExists() method in the class EventStoreLessonProjectionsRepository) stucks.
I checked the logs and I can confirm that this is the line of code where the execution stops until the timeout.
Any suggestion?
Thank you.