Spring's @DataJpaTest fails sometimes in Circle CI 2.0

In Circle CI 2.0, sometimes we are getting the following error while running tests annotated with Spring’s @DataJpaTest (the test uses an embedded in-memory database):

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.353 s <<< FAILURE! - in io.mb.lunchroulette.repositories.ParticipantRepositoryTest
[ERROR] initializationError(io.mb.lunchroulette.repositories.ParticipantRepositoryTest)  Time elapsed: 0.013 s  <<< ERROR!
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/home/circleci/repo/target/test-classes/io/mb/lunchroulette/repositories/MealEventCreationTaskDetailRepositoryTest.class]; nested exception is java.nio.channels.ClosedByInterruptException
Caused by: java.nio.channels.ClosedByInterruptException

[INFO] Running io.mb.lunchroulette.repositories.MealEventCreationTaskDetailRepositoryTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.006 s <<< FAILURE! - in io.mb.lunchroulette.repositories.MealEventCreationTaskDetailRepositoryTest
[ERROR] initializationError(io.mb.lunchroulette.repositories.MealEventCreationTaskDetailRepositoryTest)  Time elapsed: 0 s  <<< ERROR!
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/home/circleci/repo/target/test-classes/io/mb/lunchroulette/repositories/MealEventCreationTaskDetailRepositoryTest.class]; nested exception is java.nio.channels.ClosedByInterruptException
Caused by: java.nio.channels.ClosedByInterruptException

[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   MealEventCreationTaskDetailRepositoryTest.initializationError » BeanDefinitionStore
[ERROR]   ParticipantRepositoryTest.initializationError » BeanDefinitionStore Failed to ...

This does not occur locally and is only occurring randomly in Circle CI 2.0. Any ideas?

Many thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.