pytest-dev / pytest-dev/pytest-xdist

Internal error triggered with large caplog texts

Open
#717 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This behavior is reproducible (at least) for pytest==6.2.5 and pytest-xdist==2.4.0.

Consider the following code (let's call this test_large_caplog.py):

import logging


def large_string_generator(n=2147483650):
    return "x" * n


def test_1(caplog):
    caplog.set_level(logging.INFO)
    logging.info(large_string_generator())
    caplog.clear()
    assert True

If we run pytest test_large_caplog.py, it runs fine. However, pytest -n 1 test_large_caplog.py triggers an internal error.

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 issue with the shown test_large_caplog.py example under both pytest test_large_caplog.py and pytest -n 1 test_large_caplog.py. Inspect the internal error and the xdist path handling the large caplog output. Done means the distributed run no longer raises an internal error while the normal run continues to pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.