windows: Embedded mongodb processes remains active after test run in Maven
See original GitHub issueHello,
I’ve got a very annoying problem using embedded mongodb.
Setup:
<mongo-embedded-version>3.4.6</mongo-embedded-version>
Java 11
Maven 3.6.3
Spring-boot 2.6.6
Spring-cloud 3.2.4
Windows 10
spring.mongodb.embedded.version=4.2.19
I’m not a local admin on the machine, maybe related but I don’t know.
The problem is that the extract-<uuid>extractmongod.exe process gets spawned by the tests but afterwards won’t go away. It then eats my CPU and I have to kill the processes (8+ of them) manually. See attached screenshot. The problem occurs half of the time I run the tests in the project using Maven. My colleague using a Mac does not seem to have a similar problem.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why does my flapdoodle Embedded MongoDB test fail to run ...
I used https://start.spring.io/ to generate a fresh new Spring 2.0 MongoDB Maven project, and I want to have an embedded MongoDB database for...
Read more >Spring Boot Integration Testing with Embedded MongoDB
Learn how to use Flapdoodle's embedded MongoDB solution together with Spring Boot to run MongoDB integration tests smoothly.
Read more >Spring Native documentation
When spring-aot-maven-plugin is applied, mvn test -DspringAot=false runs tests in regular mode while mvn test generates related sources and run ...
Read more >4.0 Changelog — MongoDB Manual
SERVER-60290 Update Windows external auth test distribution ... jstests/core/profile2.js fails when background operations are run against test database.
Read more >Integration Testing with MongoDB & Spring Data - Medium
The initializeDB() method is annotated with @BeforeClass to start this before test case beings. This method fires up an embedded MongoDB instance which...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@michaelmosmann The code is not public. The issue occurs with tests in combination with:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-maven-intellij and https://docs.microsoft.com/en-us/samples/azure-samples/hello-spring-function-azure/hello-spring-function-azure/
Likely the way the Spring context is constructed has something to do with it.
There’s a workaround I found using
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkCount>1</forkCount> <reuseForks>false</reuseForks> </configuration> </plugin>
Especially the reuseForks=false seems to help, but it does have a significant impact on the test performance.
@behindsun there are new releases, so if this is still an issue, please reopen:)