Title: pytest-xdist run tests with --clean-alluredir may fail when faker installed. · Issue #807 · allure-framework/allure-python · GitHub
Open Graph Title: pytest-xdist run tests with --clean-alluredir may fail when faker installed. · Issue #807 · allure-framework/allure-python
X Title: pytest-xdist run tests with --clean-alluredir may fail when faker installed. · Issue #807 · allure-framework/allure-python
Description: I'm submitting a ... bug report feature request support request => Please do not submit support request here, see note at the top of this template. What is the current behavior? pytest-xdist run tests with --clean-alluredir may fail. Bec...
Open Graph Description: I'm submitting a ... bug report feature request support request => Please do not submit support request here, see note at the top of this template. What is the current behavior? pytest-xdist run te...
X Description: I'm submitting a ... bug report feature request support request => Please do not submit support request here, see note at the top of this template. What is the current behavior? pytest-xdist...
Opengraph URL: https://github.com/allure-framework/allure-python/issues/807
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":" pytest-xdist run tests with --clean-alluredir may fail when faker installed.","articleBody":"[//]: # (\r\n. Note: for support questions, please use Stackoverflow or Gitter**. \r\n. This repository's issues are reserved for feature requests and bug reports.\r\n.\r\n. In case of any problems with Allure Jenkins plugin** please use the following repository \r\n. to create an issue: https://github.com/jenkinsci/allure-plugin/issues\r\n.\r\n. Make sure you have a clear name for your issue. The name should start with a capital \r\n. letter and no dot is required in the end of the sentence. An example of good issue names:\r\n.\r\n. - The report is broken in IE11\r\n. - Add an ability to disable default plugins\r\n. - Support emoji in test descriptions\r\n)\r\n\r\n#### I'm submitting a ... \r\n - [x] bug report\r\n - [ ] feature request\r\n - [ ] support request =\u003e Please do not submit support request here, see note at the top of this template.\r\n\r\n#### What is the current behavior?\r\n pytest-xdist run tests with --clean-alluredir may fail. Because the {alluredir} already deleted by another woeker.\r\n\r\n#### If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem\r\ncreate a test file :\r\ntest.py\r\n```\r\ndef test_01():\r\n assert True\r\n```\r\ninstall the pytest, allure-pytest and pytest-xdist\r\n```\r\npip install pytest allure-pytest pytest-xdist faker\r\n```\r\nRun tests multiple times\r\n`pytest test.py -n 10 --clean-alluredir --alluredir=/tmp/allure-results`\r\n\r\nAnd your will get a error:\r\n```\r\npytest test.py -n 10 --clean-alluredir --alluredir=/tmp/allure-results\r\n============================================================================================== test session starts ===============================================================================================\r\nplatform darwin -- Python 3.10.13, pytest-8.1.1, pluggy-1.4.0\r\nrootdir: /private/tmp/allure-test\r\nplugins: allure-pytest-2.13.5, Faker-24.11.0, xdist-3.5.0\r\ninitialized: 7/10 workersINTERNALERROR\u003e Traceback (most recent call last):\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/_pytest/main.py\", line 281, in wrap_session\r\nINTERNALERROR\u003e config._do_configure()\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py\", line 1121, in _do_configure\r\nINTERNALERROR\u003e self.hook.pytest_configure.call_historic(kwargs=dict(config=self))\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_hooks.py\", line 523, in call_historic\r\nINTERNALERROR\u003e res = self._hookexec(self.name, self._hookimpls.copy(), kwargs, False)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_manager.py\", line 119, in _hookexec\r\nINTERNALERROR\u003e return self._inner_hookexec(hook_name, methods, kwargs, firstresult)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_callers.py\", line 138, in _multicall\r\nINTERNALERROR\u003e raise exception.with_traceback(exception.__traceback__)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_callers.py\", line 102, in _multicall\r\nINTERNALERROR\u003e res = hook_impl.function(*args)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/allure_pytest/plugin.py\", line 167, in pytest_configure\r\nINTERNALERROR\u003e file_logger = AllureFileLogger(report_dir, clean)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/allure_commons/logger.py\", line 18, in __init__\r\nINTERNALERROR\u003e shutil.rmtree(self._report_dir)\r\nINTERNALERROR\u003e File \"/opt/homebrew/Cellar/python@3.10/3.10.13_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/shutil.py\", line 721, in rmtree\r\nINTERNALERROR\u003e onerror(os.open, path, sys.exc_info())\r\nINTERNALERROR\u003e File \"/opt/homebrew/Cellar/python@3.10/3.10.13_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/shutil.py\", line 718, in rmtree\r\nINTERNALERROR\u003e fd = os.open(path, os.O_RDONLY)\r\nINTERNALERROR\u003e FileNotFoundError: [Errno 2] No such file or directory: '/tmp/allure-results'\r\ninitialized: 10/10 workersINTERNALERROR\u003e def worker_internal_error(self, node, formatted_error):\r\nINTERNALERROR\u003e \"\"\"\r\nINTERNALERROR\u003e pytest_internalerror() was called on the worker.\r\nINTERNALERROR\u003e\r\nINTERNALERROR\u003e pytest_internalerror() arguments are an excinfo and an excrepr, which can't\r\nINTERNALERROR\u003e be serialized, so we go with a poor man's solution of raising an exception\r\nINTERNALERROR\u003e here ourselves using the formatted message.\r\nINTERNALERROR\u003e \"\"\"\r\nINTERNALERROR\u003e self._active_nodes.remove(node)\r\nINTERNALERROR\u003e try:\r\nINTERNALERROR\u003e \u003e assert False, formatted_error\r\nINTERNALERROR\u003e E AssertionError: Traceback (most recent call last):\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/_pytest/main.py\", line 281, in wrap_session\r\nINTERNALERROR\u003e E config._do_configure()\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py\", line 1121, in _do_configure\r\nINTERNALERROR\u003e E self.hook.pytest_configure.call_historic(kwargs=dict(config=self))\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_hooks.py\", line 523, in call_historic\r\nINTERNALERROR\u003e E res = self._hookexec(self.name, self._hookimpls.copy(), kwargs, False)\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_manager.py\", line 119, in _hookexec\r\nINTERNALERROR\u003e E return self._inner_hookexec(hook_name, methods, kwargs, firstresult)\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_callers.py\", line 138, in _multicall\r\nINTERNALERROR\u003e E raise exception.with_traceback(exception.__traceback__)\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_callers.py\", line 102, in _multicall\r\nINTERNALERROR\u003e E res = hook_impl.function(*args)\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/allure_pytest/plugin.py\", line 167, in pytest_configure\r\nINTERNALERROR\u003e E file_logger = AllureFileLogger(report_dir, clean)\r\nINTERNALERROR\u003e E File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/allure_commons/logger.py\", line 18, in __init__\r\nINTERNALERROR\u003e E shutil.rmtree(self._report_dir)\r\nINTERNALERROR\u003e E File \"/opt/homebrew/Cellar/python@3.10/3.10.13_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/shutil.py\", line 721, in rmtree\r\nINTERNALERROR\u003e E onerror(os.open, path, sys.exc_info())\r\nINTERNALERROR\u003e E File \"/opt/homebrew/Cellar/python@3.10/3.10.13_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/shutil.py\", line 718, in rmtree\r\nINTERNALERROR\u003e E fd = os.open(path, os.O_RDONLY)\r\nINTERNALERROR\u003e E FileNotFoundError: [Errno 2] No such file or directory: '/tmp/allure-results'\r\nINTERNALERROR\u003e E assert False\r\nINTERNALERROR\u003e\r\nINTERNALERROR\u003e .venv/lib/python3.10/site-packages/xdist/dsession.py:200: AssertionError\r\n[gw0] node down: Not properly terminated\r\n\r\nreplacing crashed worker gw0\r\ninitialized: 11/11 workersINTERNALERROR\u003e Traceback (most recent call last):\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/_pytest/main.py\", line 285, in wrap_session\r\nINTERNALERROR\u003e session.exitstatus = doit(config, session) or 0\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/_pytest/main.py\", line 339, in _main\r\nINTERNALERROR\u003e config.hook.pytest_runtestloop(session=session)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_hooks.py\", line 501, in __call__\r\nINTERNALERROR\u003e return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_manager.py\", line 119, in _hookexec\r\nINTERNALERROR\u003e return self._inner_hookexec(hook_name, methods, kwargs, firstresult)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_callers.py\", line 138, in _multicall\r\nINTERNALERROR\u003e raise exception.with_traceback(exception.__traceback__)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_callers.py\", line 121, in _multicall\r\nINTERNALERROR\u003e teardown.throw(exception) # type: ignore[union-attr]\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/_pytest/logging.py\", line 806, in pytest_runtestloop\r\nINTERNALERROR\u003e return (yield) # Run all the tests.\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/pluggy/_callers.py\", line 102, in _multicall\r\nINTERNALERROR\u003e res = hook_impl.function(*args)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/xdist/dsession.py\", line 123, in pytest_runtestloop\r\nINTERNALERROR\u003e self.loop_once()\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/xdist/dsession.py\", line 148, in loop_once\r\nINTERNALERROR\u003e call(**kwargs)\r\nINTERNALERROR\u003e File \"/private/tmp/allure-test/.venv/lib/python3.10/site-packages/xdist/dsession.py\", line 238, in worker_errordown\r\nINTERNALERROR\u003e self._active_nodes.remove(node)\r\nINTERNALERROR\u003e KeyError: \u003cWorkerController gw0\u003e\r\n\r\n============================================================================================= no tests ran in 0.81s ==============================================================================================\r\n```\r\n\r\n#### What is the expected behavior?\r\nno error raise.\r\n\r\n#### What is the motivation / use case for changing the behavior?\r\n\r\n\r\n#### Please tell us about your environment:\r\n\r\n- Allure version: 2\r\n- Test framework: pytest@3.10.13\r\n- Allure adaptor: allure-pytest@2.13.5\r\n- Faker-24.11.0\r\n- xdist-3.5.0\r\n#### Other information \r\n\r\n[//]: # (\r\n. e.g. detailed explanation, stacktraces, related issues, suggestions \r\n. how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc\r\n)\r\n","author":{"url":"https://github.com/hokor","@type":"Person","name":"hokor"},"datePublished":"2024-04-18T12:25:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/807/allure-python/issues/807"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b0dba972-8ec8-8644-644f-d300d39a04ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 86F8:73878:3026160:4032D1C:696F2082 |
| html-safe-nonce | 9cff86178b067dc2f4b8245658883a8f05f5f1ebee650cee785f4edaa46b5b2e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkY4OjczODc4OjMwMjYxNjA6NDAzMkQxQzo2OTZGMjA4MiIsInZpc2l0b3JfaWQiOiIxNDkzNzA2MjE0NzU3ODM0ODgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e127b667b3ecbb3b66178289780d52ca7a45fa748d35b9a7c8d82880020a4fde |
| hovercard-subject-tag | issue:2250563615 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/allure-framework/allure-python/807/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c2a4ed0c73593fab54f1da64603c433951dc8eb8a7f4364fc3f08c9e5f6cb201/allure-framework/allure-python/issues/807 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c2a4ed0c73593fab54f1da64603c433951dc8eb8a7f4364fc3f08c9e5f6cb201/allure-framework/allure-python/issues/807 |
| og:image:alt | I'm submitting a ... bug report feature request support request => Please do not submit support request here, see note at the top of this template. What is the current behavior? pytest-xdist run te... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hokor |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/allure-framework/allure-python git https://github.com/allure-framework/allure-python.git |
| octolytics-dimension-user_id | 5879127 |
| octolytics-dimension-user_login | allure-framework |
| octolytics-dimension-repository_id | 79346720 |
| octolytics-dimension-repository_nwo | allure-framework/allure-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 79346720 |
| octolytics-dimension-repository_network_root_nwo | allure-framework/allure-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width