Answers: <p>It might be a memory issue, I found using Docker in Windows with WSL ate RAM to the point of crashing and I had to restart the Docker daemon, I want only creating 6 containers, and I have 16GB of RAM!</p>
  <p>If your using Docker Compose you can just run <code>docker compose up</code> and it will launch all the containers and you will get the output of each program that starts running in each container. You can then output it to a logfile for further analysis.</p>
  <p>Or if your just using Dockerfile for this I would assume it's either RAM or a DB concurrency issue or maybe if you log into the DB with the same user it has a connection limit set. If you could share your docker-compose.yaml or Dockerfile that could help us fix the issue.</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-02-22T15:25:54.687Z
Answers: Thanks for the reply. I'm not using dockerfile nor docker-compose. I'm using testcontainers which automatically creates and starts containers when running xunit tests.
Answers: Bizhan
Answers: CC BY-SA 4.0
Answers: 2024-02-22T20:12:22.543Z
Answers: Unfortunatly I've never used TestContainers but you could try and run the tests in a parallel way in a single docker container. 
  
  If your containers are using the Bash Shell you can write `test1cmd& test2cmd& test3cmd& wait` this will run test1,2,3cmd all at the same time. if you remove the ampersand they will run in a synchronous way and with the & it's asynchronous
Answers: Definity
Answers: CC BY-SA 4.0
Answers: 2024-02-21T18:05:43.597Z
Answers: 2024-02-21T18:05:43.597Z
Answers: Definity
Answers: <p>I had a similar issue where I would run my integration tests that relied on a some docker containers but they would just hang and then fail. Turns out there is an setting called &quot;Enable Resource Saver&quot; that I disabled and now my tests run fine every time. This setting can be found in Settings -&gt; Resources -&gt; Advanced</p>
  <p><a href="https://i.sstatic.net/wiNNWGwY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wiNNWGwY.png" alt="enter image description here" /></a></p>
  
Answers: CC BY-SA 4.0
Answers: 2024-07-15T10:24:12.153Z
Answers: 2024-07-15T10:24:12.153Z
Answers: Daniaal
Body: <p>I'm running my dotnet 7.0 tests using &quot;testcontainers&quot; on windows machine. The tests are parallelized integration tests which use SQL Server inside a Linux docker container. Each test creates its own database.</p>
  <p>When I run less than 16 tests at the same time, they all pass. But when I run more than that (and my IDE limits it to 16) it gets stuck and nothing will happen. If I wait for a day it's still trying to run the first 16 tests.</p>
  <p>Same thing happens on VS and Rider.</p>
  <p>There is nothing interesting in docker logs and I don't know where else to look.</p>
  <p>When I open the task manager I can see that docker keeps restarting some its services, as it's constantly alternating between these two states:</p>
  <p><a href="https://i.sstatic.net/316bU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/316bU.png" alt="enter image description here" /></a>
  <a href="https://i.sstatic.net/PYT1B.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PYT1B.png" alt="enter image description here" /></a></p>
  <h2>Update:</h2>
  <p>I found a solution by limiting the parallel tests in my infrastructure by running batches of 10. But I'm still wondering why this happens in the first place. Is it testcontainers bug or docker's? Anyone else has a similar experience?</p>
  
Tags: <docker><windows><testing><ubuntu><dotnet>
Title: Docker gets stuck when running 16 tests
UserDisplayName: Bizhan
ThreadText: # Docker gets stuck when running 16 tests
  
  (Asked by: username_0 on 2024-02-20)
  
  I'm running my dotnet 7.0 tests using "testcontainers" on windows machine. The tests are parallelized integration tests which use SQL Server inside a Linux docker container. Each test creates its own database.
  
  When I run less than 16 tests at the same time, they all pass. But when I run more than that (and my IDE limits it to 16) it gets stuck and nothing will happen. If I wait for a day it's still trying to run the first 16 tests.
  
  Same thing happens on VS and Rider.
  
  There is nothing interesting in docker logs and I don't know where else to look.
  
  When I open the task manager I can see that docker keeps restarting some its services, as it's constantly alternating between these two states:
  
  [![enter image description here](https://i.sstatic.net/316bU.png)](https://i.sstatic.net/316bU.png)
  [![enter image description here](https://i.sstatic.net/PYT1B.png)](https://i.sstatic.net/PYT1B.png)
  
  ## Update:
  
  I found a solution by limiting the parallel tests in my infrastructure by running batches of 10. But I'm still wondering why this happens in the first place. Is it testcontainers bug or docker's? Anyone else has a similar experience?
  
  **Tags:** docker, windows, testing, ubuntu, dotnet
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-02-21. Score: 0
  
  It might be a memory issue, I found using Docker in Windows with WSL ate RAM to the point of crashing and I had to restart the Docker daemon, I want only creating 6 containers, and I have 16GB of RAM!
  
  If your using Docker Compose you can just run `docker compose up` and it will launch all the containers and you will get the output of each program that starts running in each container. You can then output it to a logfile for further analysis.
  
  Or if your just using Dockerfile for this I would assume it's either RAM or a DB concurrency issue or maybe if you log into the DB with the same user it has a connection limit set. If you could share your docker-compose.yaml or Dockerfile that could help us fix the issue.
  
  > **Comments:**
  > **username_0**: Thanks for the reply. I'm not using dockerfile nor docker-compose. I'm using testcontainers which automatically creates and starts containers when running xunit tests.  
  > **username_1**: Unfortunatly I've never used TestContainers but you could try and run the tests in a parallel way in a single docker container.   If your containers are using the Bash Shell you can write `test1cmd& test2cmd& test3cmd& wait` this will run test1,2,3cmd all at the same time. if you remove the ampersand they will run in a synchronous way and with the & it's asynchronous  
  
  ---
  
  ### Answer by username_2 on 2024-07-15. Score: 0
  
  I had a similar issue where I would run my integration tests that relied on a some docker containers but they would just hang and then fail. Turns out there is an setting called "Enable Resource Saver" that I disabled and now my tests run fine every time. This setting can be found in Settings -> Resources -> Advanced
  
  [![enter image description here](https://i.sstatic.net/wiNNWGwY.png)](https://i.sstatic.net/wiNNWGwY.png)
  
  
  ---
  
  