Open istepanko opened 6 years ago
Interesting. Are you seeing this with --workers
or --tests-per-worker
?
Looks like it happens in either scenario. Thanks for reporting!
Same issue for me.
@kevlened you wrote an amazing and very useful plugin, love it.
The main issue is that reporting is broken: --junit
option causes xml report to be written empty, and pytest-html
makes messy report with mixed output from different tests. This makes plug to be impossible to use in production :(
Let me know if I can help, I would like to.
Thanks for the feedback. The --junitxml
problem is new to me, but I've created an issue to track it: #24. I also wasn't aware that pytest-html
created a messy report. If you can open an issue with a screenshot, that'd be helpful.
Same issue . I am also facing . Anyone tried any hook or code for temporary fix
Same goes for STDOUT/STDERR. I tried to hack around a bit with multiprocessing.RLock() but it does not work at all because pytest has its own output capturing code
I tried using queues + QueueHandler and QueueListener, and now the html report produced from pytest-html is sorted - I see the correct order of the log messages in the report but its duplicated for each scenario like so: first scenario has the messages for first seenario second scenario has the messages for first scenario and second scenario third scenario has the messages for first scenario, second scenario and third scenario and so on
solution I used is here under section: Dealing with handlers that block https://docs.python.org/3.7/howto/logging-cookbook.html
Im using python 3.8, pytest==5.3.5, pytest-html==2.0.1, pytest-parallel==0.0.10.
Hi @kevlened - is there any plans to fix this issue
Hi @kevlened ,even i'm stuck on this issue as well, any timeline for the fix?
I'm experiencing this (in May 2022) as well
On my Ubuntu 21.10 system, I've got Python 3.9.7 (CPython) with:
pytest 7.1.1
pytest-html 3.1.1
pytest-parallel 0.1.1
pytest-xdist 2.5.0
...and this test file:
...which I run in these two variations:
pytest-xdist:
$ pytest --html=report.html --self-contained-html -n auto test_junk.py
pytest-parallel:
$ pytest --html=report.html --self-contained-html --workers auto test_junk.py
The pytest-xdist run yields this output for test test_junk.py::test_001:
[gw0] linux -- Python 3.9.7 /home/mnaumann/PycharmProjects/Parallelism/venv/bin/python
[gw0] linux -- Python 3.9.7 /home/mnaumann/PycharmProjects/Parallelism/venv/bin/python[gw0] linux -- Python 3.9.7 /home/mnaumann/PycharmProjects/Parallelism/venv/bin/python[gw0] linux -- Python 3.9.7 /home/mnaumann/PycharmProjects/Parallelism/venv/bin/python
------------------------------Captured stdout call------------------------------
Current test: test_001
Sleeping for 4 seconds...
The pytest-parallel run yields this output for test test_junk.py::test_001:
------------------------------Captured stdout call------------------------------
Current test: test_006
Sleeping for 2 seconds...
On repeated runs, the pytest-xdist consistently sends test output to the correct individual test report.
The pytest-parallel output is invariably inconsistent. Some individual test reports have the output of several individual tests:
------------------------------Captured stdout call------------------------------
Current test: test_002
Sleeping for 3 seconds...
Current test: test_003
Sleeping for 4 seconds...
Current test: test_004
Sleeping for 3 seconds...
...while others are empty:
No log output captured.
So the output is mixed instead of be per test