hey, just ran into this: 1. When I run a test tha...
# general
h
hey, just ran into this: 1. When I run a test that has failures the failing test that uses the testing.postgresql module the test hangs 2. When I run that same test with
--test-debug
then it completes. albeit with the test failures 3. When I get the tests to pass running w/out
--test-debug
works
h
Hey Nate. Hm, are you only running a single test file every time? A main difference between
--debug
is that it runs one test at-a-time in the foreground, whereas
--no-debug
runs multiple in parallel. But if you only have one test file you're running, that's irrelevant
h
i was running pants test :: when i noticed it
i then tried to run that individual test and it hung
the testing.postgresql module forks a postgres server
h
i was running pants test :: when i noticed it
This could be contention. Are they all accessing the same database? How is that database created?
i then tried to run that individual test and it hung
Depending on how the database is created, I wonder if there was a process running independently of Pants that was hung
h
i just ran a test, i did notice multiple postgres instances running so i killed them all. Then i ran that individual test only w/out --test-debug. It’s now hanging. There are two postgres procs running
Copy code
jenkins+ 22261     1  0 13:15 pts/0    00:00:00 /usr/lib/postgresql/10/bin/postgres -p 56931 -D /tmp/tmpjJ1Xkj/data -k /tmp/tmpjJ1Xkj/tmp -h 127.0.0.1 -F -c logging_collector=off
jenkins+ 22287     1  0 13:15 pts/0    00:00:00 /usr/lib/postgresql/10/bin/postgres -p 56647 -D /tmp/tmpROxmct/data -k /tmp/tmpROxmct/tmp -h 127.0.0.1 -F -c logging_collector=off
h
Any chance you can reproduce this in a sample repo? I would love to figure this out.
h
i’ll try to get something up with the testing.postgresql module
h
Hey @helpful-lunch-92084, just wondering if you have anything we can look at for this? Thanks!
h
oh yah, i’ll try to whip something up today
h
Not urgent, but would like to solve for you and other users that will likely have the same issue. Thanks!
h
hey @happy-kitchen-89482
so i created a test that demonstrates the issue
but i don’t think it’s a pants issue per se
👀 1
seems to occur on py2 only
🐍 1
and with unittest’s setUpClass
anyway, if you’re curious, here’s a patch you could apply to the pants repo locally to validate, i had to enable py2 stuff and disable some constraints stuff to get py2 working
cycletest.patch
in our repo we didn’t have the timeout_default set. that will work for us as a workaround for now
h
Thanks!
So to clarify, this works with Python 3?
h
yes
h
hmm
I had assumed this was an issue with Pants, but if it works with Python3, it may be more of an issue with older pytest, as you suggest.
I'll take a look