pytest hangs in Docker #6349
Replies: 10 comments 3 replies
-
Hi @dmurvihill, That's weird. What happens if you change your entry point to:
|
Beta Was this translation helpful? Give feedback.
-
could be related to python buffering, i suggest to use PYTHONUNBUFFERED to see what happens |
Beta Was this translation helpful? Give feedback.
-
Always freezes in python:3.7-stretch on the second run for me.
|
Beta Was this translation helpful? Give feedback.
-
Hi there, We just encountered a very similar issue when starting working with Github Actions CI. A Django project with something like 150 tests involving PostgreSQL. Everything running fine on local developers computers (macOS, Ubuntu 18.04, Ubuntu 20.04) and on our previous CI (Codeship). With Github Actions (which use Docker), pytests hangs at a specific test (always the same). I tried:
|
Beta Was this translation helpful? Give feedback.
-
Correction: my idea of |
Beta Was this translation helpful? Give feedback.
-
Just throwing some suggestions that I would use to investigate further:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @nicoddemus for your suggestions. The test in question is a bit big in terms of fixtures, but nothing enormous either: about 20 Django model objects that are saved to PostgreSQL database, some of them being then modified by factory_boy post-generation operations. Your simple-yet-I-didn't-think-of-it idea of debugging with |
Beta Was this translation helpful? Give feedback.
-
Another tip: try using |
Beta Was this translation helpful? Give feedback.
-
I'm struggling with this issue. In my case, it appears that the hang (or sometimes crash) occurs during migrations. When I run (The crash only seems to happen when running from the command line like this; if I run from within PyCharm, it's just a hang.) |
Beta Was this translation helpful? Give feedback.
-
We ran into a similar problem where it looked like tests were hanging when running on Azure Pipelines or in GitHub Actions—they would run up to
but because the first line never wrote, it looked like
Using |
Beta Was this translation helpful? Give feedback.
-
docker-compose.yml
:Dockerfile
:Pipfile
:test_samedir.py
tests/test_subdir.py
Executing this environment, you get this:
And it hangs there forever. I'd expect it to report 1 or 2 tests passed.
Beta Was this translation helpful? Give feedback.
All reactions