<p>we've just started to move a spring boot project to a new build system. Previously everything ran with gitlab docker runners and should now work with a kubernetes runner.
When I run the exact same build pipeline with the same docker image on k8s instead with the old runner the tests will run infinite until they reach gitlabs pipeline timeout.</p>
<p>This is always the last line in the log after which spring just seems to just hang:</p>
<pre><code>2021-01-14 09:30:18.126 DEBUG 536 --- [    Test worker] .c.JpaMetamodelMappingContextFactoryBean : Initializing JpaMetamodelMappingContext…
</code></pre>
<p>If I connect into the pod an run the ./gradlew test --debug command by hand it will also hang most of the times and sometimes miraculously finish.</p>
<p>I'm very much out of ideas right now why spring would suddenly hang at/after that specific point in the code. I've searched a little bit through the org.springframework.data.jpa.repository.config.JpaMetamodelMappingContextFactoryBean.createInstance() code to maybe get a clue why this is happening, but no luck so far.</p>
<p>I mean based on the fact that it works in every other environment we have it, the problem should be related to the kubernetes env but I'm not sure how this would make spring hang at the code mentioned above. Maybe some kind of race condition since it sometimes does work, when run by hand?</p>
<p>The gitlab ci stage right now looks like this</p>
<pre><code>test:all:
  image: openjdk:11
  stage: test
  tags:
    - kubernetes
  script:
    - ./gradlew assemble --build-cache
    - ./gradlew test
</code></pre>

Finn
<p>Turns out upgrading Spring Boot 2.3.4-RELEASE to 2.4.1 fixes the problem.</p>
