这是indexloc提供的服务,不要输入任何密码
Skip to content

test_perf_profiler: race condition when cleaning up perf-*.map files #141592

@pareshjoshij

Description

@pareshjoshij

Bug report

Bug description:

What happens

Lib/test/test_perf_profiler.py uses setUp/tearDown to record all perf-*.map files in /tmp at test start, then deletes any new ones at the end.

When tests run in parallel (make -j, CI runners, pytest-xdist), one test deletes map files belonging to another testrace condition.

This causes:

  • Flaky test failures
  • Leftover /tmp/perf-*.map files
  • Unreliable CI results

What should happen

Each test should only delete the perf-*.map file(s) it created, regardless of other concurrent processes.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-profilingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions