Skip to content

Tests: test_trampoline_works_with_forks assertions are incomplete #141612

@pareshjoshij

Description

@pareshjoshij

Bug report

Bug description:

The test test_trampoline_works_with_forks in Lib/test/test_perf_profiler.py is incomplete and does not fully validate the correctness of the perf map generation after a fork.

Current Behavior: The test correctly asserts that:

The parent process's symbols (e.g., py::foo, py::bar) are present in the parent's perf-*.map file.

The child process's symbols (e.g., py::foo_fork, py::bar_fork) are present in the child's perf-*.map file.

The Bug: The test fails to check the inverse. It does not assert that:

The child's symbols are absent from the parent's map file.

The parent's symbols are absent from the child's map file.

This is a gap in the test logic, as it could incorrectly pass even if the perf map logic was improperly mixing symbols between the parent and child processes.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixestestsTests 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