Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_monitoring fails when run multiple times: ValueError: tool 0 is already in use #109357

Closed
vstinner opened this issue Sep 13, 2023 · 1 comment

Comments

@vstinner
Copy link
Member

vstinner commented Sep 13, 2023

The issue broke all Refleaks buildbots :-(

Example:

$ ./python -m test test_monitoring -R 3:3
0:00:00 load avg: 3.50 Run 1 test sequentially
0:00:00 load avg: 3.50 [1/1] test_monitoring
beginning 6 repetitions
123456
.test test_monitoring failed -- Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_monitoring.py", line 1723, in test_gh108976
    sys.monitoring.use_tool_id(0, "test")
ValueError: tool 0 is already in use

test_monitoring failed (1 error)

== Tests result: FAILURE ==

1 test failed:
    test_monitoring

Total duration: 454 ms
Total tests: run=63
Total test files: run=1/1 failed=1
Result: FAILURE

The regression was introduced by: commit 4a69301 of PR GH-109131. cc @markshannon

commit 4a69301ea4539da172a00a80e78c07e9b41c1f8e
Author: Mark Shannon <mark@hotpy.org>
Date:   Mon Sep 11 14:37:09 2023 +0100

    GH-108976. Keep monitoring data structures valid during de-optimization during callback. (GH-109131)

Python 3.12 is also affected, the change was backported to 3.12: cc @Yhg1s

Linked PRs

vstinner added a commit to vstinner/cpython that referenced this issue Sep 13, 2023
The test now calls free_tool_id() so it can be run multiple times in
the same process. For example, the following command no longer fails:

    python -m test test_monitoring -R 3:3
@vstinner
Copy link
Member Author

Oh wait, it's simple to fix this issue in fact: I wrote PR #109358.

vstinner added a commit that referenced this issue Sep 13, 2023
The test now calls free_tool_id() so it can be run multiple times in
the same process. For example, the following command no longer fails:

    python -m test test_monitoring -R 3:3
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 13, 2023
The test now calls free_tool_id() so it can be run multiple times in
the same process. For example, the following command no longer fails:

    python -m test test_monitoring -R 3:3
(cherry picked from commit 388d91c)

Co-authored-by: Victor Stinner <vstinner@python.org>
Yhg1s pushed a commit that referenced this issue Sep 13, 2023
…09359)

gh-109357: Fix test_monitoring.test_gh108976() (GH-109358)

The test now calls free_tool_id() so it can be run multiple times in
the same process. For example, the following command no longer fails:

    python -m test test_monitoring -R 3:3
(cherry picked from commit 388d91c)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit to vstinner/cpython that referenced this issue Sep 13, 2023
The test now calls free_tool_id() so it can be run multiple times in
the same process. For example, the following command no longer fails:

    python -m test test_monitoring -R 3:3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant