classification
Title: Increase Code Coverage for multiprocessing.shared_memory
Type: Stage: resolved
Components: Tests Versions: Python 3.9
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: davin, pablogsal, vinay0410
Priority: normal Keywords: patch

Created on 2019-09-03 13:58 by vinay0410, last changed 2020-07-20 09:15 by vinay0410. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15662 merged vinay0410, 2019-09-03 14:09
PR 15821 merged vinay0410, 2019-09-10 04:03
Messages (11)
msg351085 - (view) Author: Vinay Sharma (vinay0410) * Date: 2019-09-03 13:58
Increase Code coverage for multiprocessing.shared_memory.SharedMemory Class
msg351113 - (view) Author: Vinay Sharma (vinay0410) * Date: 2019-09-04 03:53
Can anyone please review my pull request. No Reviewer has been assigned yet to it. And I don't have permissions to request a review.
msg351531 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2019-09-09 16:48
New changeset d14e39c8d9a9b525c7dcd83b2a260e2707fa85c1 by Davin Potts (Vinay Sharma) in branch 'master':
bpo-38018: Increase code coverage for multiprocessing.shared_memory (GH-15662)
https://github.com/python/cpython/commit/d14e39c8d9a9b525c7dcd83b2a260e2707fa85c1
msg351544 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-09-09 18:37
PR15552 introduced a regression in FreeBSD buildbots:

https://buildbot.python.org/all/#/builders/168/builds/1417

Could you take a look?
msg351553 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2019-09-09 21:33
Initial review of the test failure suggests a likely flaw in the mechanism used by the resource tracker.

I will continue investigating more tomorrow.
msg351557 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-09-09 22:11
This is the failure for reference:

======================================================================
ERROR: test_shared_memory_basics (test.test_multiprocessing_spawn.WithProcessesTestSharedMemory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py", line 3737, in test_shared_memory_basics
    shm1 = shared_memory.SharedMemory(create=True, size=1)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/shared_memory.py", line 89, in __init__
    self._fd = _posixshmem.shm_open(
OSError: [Errno 22] Invalid argument: 'test01_fn'
----------------------------------------------------------------------
msg351560 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-09-09 22:12
Correction, is PR 15662 the one that introduced the recession (the one in this issue) not the previous one I linked. Apologies for that.
msg351570 - (view) Author: Vinay Sharma (vinay0410) * Date: 2019-09-10 04:58
Hi I have opened another PR: https://github.com/python/cpython/pull/15821
This should fix test failures in FreeBSD.

FreeBSD requires a leading slash in shared memory names. That's why it was throwing the below error:

======================================================================
ERROR: test_shared_memory_basics (test.test_multiprocessing_spawn.WithProcessesTestSharedMemory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/_test_multiprocessing.py", line 3737, in test_shared_memory_basics
    shm1 = shared_memory.SharedMemory(create=True, size=1)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/multiprocessing/shared_memory.py", line 89, in __init__
    self._fd = _posixshmem.shm_open(
OSError: [Errno 22] Invalid argument: 'test01_fn'
----------------------------------------------------------------------

test01_fn doesn't contain a leading slash that's why it is an invalid argument.
msg351572 - (view) Author: Vinay Sharma (vinay0410) * Date: 2019-09-10 05:26
Also, I haven't made a NEWS entry since it's just a short bug fix
msg351579 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2019-09-10 06:48
New changeset 2fc1160a80733f4c5c88796319154b3f59e98e4b by Pablo Galindo (Vinay Sharma) in branch 'master':
bpo-38018: Fix test for multiprocessing.shared_memory in BSD systems (GH-15821)
https://github.com/python/cpython/commit/2fc1160a80733f4c5c88796319154b3f59e98e4b
msg373995 - (view) Author: Vinay Sharma (vinay0410) * Date: 2020-07-20 09:15
Closing this, as all the necessary PRs have been merged.
History
Date User Action Args
2020-07-20 09:15:11vinay0410setstatus: open -> closed

messages: + msg373995
stage: patch review -> resolved
2019-09-10 06:48:31pablogsalsetmessages: + msg351579
2019-09-10 05:26:45vinay0410setmessages: + msg351572
2019-09-10 04:58:47vinay0410setmessages: + msg351570
2019-09-10 04:03:47vinay0410setpull_requests: + pull_request15469
2019-09-09 22:12:57pablogsalsetmessages: + msg351560
2019-09-09 22:11:08pablogsalsetmessages: + msg351557
2019-09-09 21:33:55davinsetmessages: + msg351553
2019-09-09 18:37:14pablogsalsetnosy: + pablogsal
messages: + msg351544
2019-09-09 16:48:58davinsetmessages: + msg351531
2019-09-04 03:53:56vinay0410setmessages: + msg351113
2019-09-03 14:09:48vinay0410setkeywords: + patch
stage: patch review
pull_requests: + pull_request15327
2019-09-03 14:03:32xtreaksetnosy: + davin
2019-09-03 13:58:05vinay0410create