bloomberg / bloomberg/pytest-memray

Disable the caplog fixture by default

Open
#29 0 comments 2 reactions 0 assignees View on GitHub
documentation good first issue help wanted
Dominant language
Python
Stars
423
Forks
39
Avg merge
5h 19m
Merged PRs (30d)
1

Description

When profiling a service that generates logs pytest by default automatically collects all log records. This makes the memory profile not true to real life as all log lines are part of the peak memory usage, though in practice after every log that record would be removed. This feature can be disabled for pytest via `-p no:logging`. At the very least we should document this under gotcha's or even better provide a marker that does this?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing how pytest's logging plugin and caplog fixture are enabled during a memray profile, then reproduce the memory impact with `-p no:logging` as the comparison. Done means profiling no longer includes unwanted retained log records, or the supported workaround and any marker behavior is documented under gotchas.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.