pytest-xdist icon indicating copy to clipboard operation
pytest-xdist copied to clipboard

Installing pytest-xdist 1.29.0 hangs all pytests

Open lkelly93 opened this issue 7 years ago • 10 comments

Tested on two computers. PC: OS WIn10 Pro 1903 64bit i7-8700K

pytest 5.0.0 pytest-xdist 1.29.0 pytest-forked 1.0.2

Laptop: OS Win10 Pro 1903 64bit i7-8650U

pytest 5.0.0 pytest-xdist 1.29.0 pytest-forked 1.0.2

I normally run "pytest -v --numprocesses=auto" but this hangs, if also if I just run pytest by itself it just hangs. I noticed this after reinstalling pytest-xdist recently. I went to check on my laptop if it was hanging and it wasn't so I checked what version my laptop was on and it was on pytest.xdist 1.28.0. I installed pytest-xdist 1.29.0 on my laptop and now everything is hanging on it aswell.

If i uninstall pytest-xdist and pytest-forked on both my machines I can run my tests again but obviously not in parallel.

I'm new to this what more information do you need from me to fully troubleshoot this? Can in install a legacy version of pytest-dist easily?

lkelly93 avatar Jul 03 '19 00:07 lkelly93

Hi @LukeJelly,

Strange, we haven't received any reports of 1.29 just hanging. We also use that version daily without problems.

Do you see this hanging with any repository or just with a specific repository? I suggest you try running pytest in a dummy repository with a few tests to see if you get the same behavior.

Unfortunately pytest 5.0 requires pytest-xdist 1.29, so unless you downgrade pytest too, you cannot really downgrade pytest-xdist.

nicoddemus avatar Jul 03 '19 17:07 nicoddemus

I'll create a new test repository right now and check it out. The repository I'm working with right now is this one.

Edit: I just created a single simple file of three "example tests" and tried to run it before and after installing xdist. They ran fine before but after installing xdist they stopped running. I can try wiping my computer and trying again. Is there anything else you would like troubleshooting wise before I wipe the computer and try again?

I had a buddy run this same repo above on his home Windows 10 computer and he was able to do it fine. I don't know all his status but he is on the newest version of pytest and pytest-xdist.

lkelly93 avatar Jul 04 '19 00:07 lkelly93

it would be really helpful to figure where exactly it actually hangs,

if you could get fault-handler trace or anything that indicates where exactly it hangs, it would be a big help

RonnyPfannschmidt avatar Jul 04 '19 04:07 RonnyPfannschmidt

@RonnyPfannschmidt I don't know what I changed but they tests are working now in parallel. I really haven't done much besides change my test.py files up a little bit. I'm gonna close this for now and I'll come back and post again if I figured out what I changed.

Thanks for the help!

lkelly93 avatar Jul 04 '19 04:07 lkelly93

I figured out the issue. If you install pytest-xdist as and administrator and then run pytest with out admin privileges pytest-forked tries to make a temporary folder in the directory it is installed in but does not have permissions this causes everything to hang. The fix is to uninstall and reinstall using --user or run all your tests as an administrator.

lkelly93 avatar Jul 08 '19 22:07 lkelly93

Thanks @LukeJelly for following up with your findings. 👍

nicoddemus avatar Jul 11 '19 10:07 nicoddemus

@LukeJelly I am also experiencing this. I am following your suggestion, but not successful as of yet.

BwL1289 avatar Mar 04 '20 15:03 BwL1289

Thanks @LukeJelly. Im on MacOS, so may not be the same issue. Will give it a try and let you know.

BwL1289 avatar Mar 04 '20 15:03 BwL1289

@BwL1289 I was mistaken in my last comment so I deleted it. I was on Windows not Ubuntu. What I was doing was launching powershell as admin then installing pytest. If you uninstall pytest as admin, then reinstall in a non elevated command prompt it fixed it for me.

As for MacOS, I am not super familiar with that you could try using the --user tag see if that helps!

Good luck!

lkelly93 avatar Mar 04 '20 15:03 lkelly93

Thank you!

BwL1289 avatar Mar 04 '20 15:03 BwL1289