Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py.test --reportportal ./tests/test_flight.py fails, So does pytest --tests-per-worker 2 --reportportal #89

Closed
shrinivasbb opened this issue Sep 13, 2018 · 7 comments
Assignees
Milestone

Comments

@shrinivasbb
Copy link

shrinivasbb commented Sep 13, 2018

Below are the failure logs, Creates a launch in the report portal but tests are not executed and launch does not end:

C:\Users\sb\PycharmProjects\pyTest1>py.test --reportportal ./tests/test_flight.py
============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-3.8.0, py-1.6.0, pluggy-0.7.1
rootdir: C:\Users\sb\PycharmProjects\pyTest1, inifile: pytest.ini
plugins: xdist-1.23.0, rerunfailures-4.1, reportportal-1.0.4, parallel-0.0.3, metadata-1.7.0, html-1.19.0, forked-0.2, concurrent-0.1.2, allure-pytest-2.5.1
collecting 0 items
DevTools listening on ws://127.0.0.1:12593/devtools/browser/fd6154c2-e371-4f69-a097-503b9795f29f
collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages_pytest\main.py", line 178, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages_pytest\main.py", line 215, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\hooks.py", line 258, in call
INTERNALERROR> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\manager.py", line 67, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\manager.py", line 61, in
INTERNALERROR> firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\callers.py", line 201, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\callers.py", line 76, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\callers.py", line 180, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pytest_concurrent.py", line 126, in pytest_runtestloop
INTERNALERROR> _run_items(mode=mode, items=ungrouped_items, session=session, workers=workers)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pytest_concurrent.py", line 164, in _run_items
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\hooks.py", line 258, in call
INTERNALERROR> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\manager.py", line 67, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\manager.py", line 61, in
INTERNALERROR> firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\callers.py", line 201, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\callers.py", line 76, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pluggy\callers.py", line 175, in _multicall
INTERNALERROR> next(gen) # first yield
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pytest_reportportal\listener.py", line 32, in pytest_runtest_protocol
INTERNALERROR> self.PyTestService.start_pytest_item(item)
INTERNALERROR> File "c:\users\sb\appdata\local\programs\python\python37-32\lib\site-packages\pytest_reportportal\service.py", line 194, in start_pytest_item
INTERNALERROR> part = self._start_stack.pop(0)
INTERNALERROR> IndexError: pop from empty list

@bigbZik
Copy link
Contributor

bigbZik commented Sep 13, 2018

See #87

@shrinivasbb
Copy link
Author

shrinivasbb commented Sep 14, 2018

Could you please let me know when the fix would be available? And I am using pytest-parallel not pytest-xdist.

@bigbZik
Copy link
Contributor

bigbZik commented Sep 14, 2018

Did it work before with RP on your setup?

@krasoffski
Copy link
Collaborator

Existing fix for xdist uses internal implementation of master slave of xdist. It seems for me that it did not work with pytest-parallel before but not sure. Need to dive into pytest-parallel internals for more details.

@shrinivasbb
Copy link
Author

Well, I am using pytest to run selenium tests. Since pytest-parallel is thread-safe it is recommended for selenium tests and pytest-xdist is not thread safe.

@bigbZik it never worked with pytest-parallel. But my RP setup is flawless, able to update test runs using TestNG java

@ringods
Copy link

ringods commented Dec 12, 2018

I tested 1.0.4 of this pytest plugin, but also get the error IndexError: pop from empty list consistently. I do not have pytest-parallel or pytest-xdist. I do have a custom written plugin for my own test collection, but this follows the pytest callback very meticulously.

@HardNorth HardNorth self-assigned this Dec 6, 2021
@HardNorth HardNorth added this to the 5.1 milestone Jan 4, 2022
@HardNorth
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants