Skip to content

Conversation

@YvesDup
Copy link
Contributor

@YvesDup YvesDup commented Feb 10, 2025

Fix and simplify a test of test_repr_rlock about multiprocessing.RLock primitive.
I am wondering if this fix must not be apply to the identical test of primitive multiprocessing.Lock (in test_repr_lock).

@YvesDup YvesDup requested a review from gpshead as a code owner February 10, 2025 14:27
@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Feb 10, 2025
@picnixz picnixz changed the title gh129401: Test repr rlock failing randomly gh-129401: Test repr rlock failing randomly Feb 10, 2025
Co-authored-by: Sam Gross <colesbury@gmail.com>
@colesbury colesbury added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 1, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit a801408 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F129959%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 1, 2025
Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@colesbury colesbury self-assigned this Mar 1, 2025
@colesbury colesbury merged commit a98a6bd into python:main Mar 1, 2025
50 checks passed
@YvesDup YvesDup deleted the test_repr_rlock_failing_randomly branch March 6, 2025 18:10
@ruiyangke
Copy link
Contributor

ruiyangke commented Feb 2, 2026

Hi @colesbury , I think we may need to backport this fix to 3.13, see #144381 (comment)

Also, we should add a p.join() after p.terminate(). see

p = self.Process(target=self._acquire_event,
args=(lock, event),
name='P2')
p.start()
event.wait()
self.assertEqual(f'<Lock(owner=SomeOtherProcess)>', repr(lock))
p.terminate()

What do you think? If that’s the right approach, I’d be happy to submit a PR.

@colesbury colesbury added the needs backport to 3.13 bugs and security fixes label Feb 2, 2026
@miss-islington-app
Copy link

Thanks @YvesDup for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 2, 2026
Fix and simplify a test of `test_repr_rlock` about multiprocessing.RLock primitive.
(cherry picked from commit a98a6bd)

Co-authored-by: Duprat <yduprat@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 2, 2026

GH-144405 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Feb 2, 2026
@colesbury
Copy link
Contributor

Also, we should add a p.join() after p.terminate(). What do you think? If that’s the right approach, I’d be happy to submit a PR.

Yeah, that sounds right to me. Please open a PR

colesbury pushed a commit that referenced this pull request Feb 2, 2026
Fix and simplify a test of `test_repr_rlock` about multiprocessing.RLock primitive.
(cherry picked from commit a98a6bd)

Co-authored-by: Duprat <yduprat@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants