https://pantsbuild.org/ logo
#general
Title
# general
h

helpful-lunch-92084

01/28/2021, 5:17 PM
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

hundreds-father-404

01/28/2021, 5:37 PM
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

helpful-lunch-92084

01/28/2021, 5:47 PM
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

hundreds-father-404

01/28/2021, 6:06 PM
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

helpful-lunch-92084

01/28/2021, 6:18 PM
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

happy-kitchen-89482

01/28/2021, 10:04 PM
Any chance you can reproduce this in a sample repo? I would love to figure this out.
h

helpful-lunch-92084

01/28/2021, 10:06 PM
i’ll try to get something up with the testing.postgresql module
h

happy-kitchen-89482

02/04/2021, 7:16 AM
Hey @helpful-lunch-92084, just wondering if you have anything we can look at for this? Thanks!
h

helpful-lunch-92084

02/04/2021, 3:45 PM
oh yah, i’ll try to whip something up today
h

happy-kitchen-89482

02/04/2021, 5:23 PM
Not urgent, but would like to solve for you and other users that will likely have the same issue. Thanks!
h

helpful-lunch-92084

02/09/2021, 7:56 PM
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

happy-kitchen-89482

02/09/2021, 8:49 PM
Thanks!
So to clarify, this works with Python 3?
h

helpful-lunch-92084

02/09/2021, 8:56 PM
yes
h

happy-kitchen-89482

02/09/2021, 11:41 PM
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
4 Views