pytest-dev / pytest-dev/pytest-xdist

Question: Is there any way to add the stack trace in report if any test crashes due to Segmentation Fault

Open
#956 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
287
Avg merge
9h 30m
Merged PRs (30d)
2

Description

I have case where test is failing and in the report we get "worker 'gw0' crashed while running 'test_invalid_data]"
On my screen I do the reason like below:

Fatal Python error: Segmentation fault

Thread 0x00007fca0ebc8700 (most recent call first):
  File "/tmp/lib/python3.8/site-packages/execnet/gateway_base.py", line 474 in read
  File "/tmp/lib/python3.8/site-packages/execnet/gateway_base.py", line 507 in from_io
  File "/tmp/lib/python3.8/site-packages/execnet/gateway_base.py", line 1049 in _thread_receiver
  File "/tmp/lib/python3.8/site-packages/execnet/gateway_base.py", line 296 in run
  File "/tmp/lib/python3.8/site-packages/execnet/gateway_base.py", line 361 in _perform_spawn

In the pytest-report which is html or xml both doesn't have trace info into it unlike the failure times.
Is there any way That we can append the above info inside the report when run via xdist?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported worker crash with xdist and compare the HTML and XML reports with the console output. Trace how worker crashes and their output are collected, then determine whether the stack trace can be preserved in both report formats. Done means the relevant trace information appears in the generated reports for a segmentation-fault crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.