Skip to content

Don't check thread safety of deselected tests #153

@nickodell

Description

@nickodell

I have an optimization / feature request.

When I'm running pytest-run-parallel in SciPy, I am usually doing two steps.

  • A broad run that operates over all tests, to identify failing tests
  • Focused runs on specific tests, to identify specific pytest-run-parallel settings which can reproduce the problem.

When I am doing the second step, it's helpful for pytest to run quickly, because I want to experiment with different combinations of taskset, iterations, and parallel-threads to find what can consistently reproduce the problem. I will usually use an option like -k to filter down what is collected.

Here is an example of a sort of test command line I will use:

spin test -s stats -- -k test_cdf_nolan_samples --parallel-threads=2

Unfortunately, the time spent in _is_thread_unsafe seems to scale with the number of collected tests, rather than the number of selected tests. This specific example spends about 68% of its time running thread safety checks.

My optimization request is that pytest-run-parallel skip checking thread safety for tests which are deselected. I am not sure exactly how difficult this is, so I apologize if this is an unreasonable request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions