]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45052: Unskips a failing `test_shared_memory_basics` test (GH-28182)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 6 Sep 2021 16:55:34 +0000 (19:55 +0300)
committerGitHub <noreply@github.com>
Mon, 6 Sep 2021 16:55:34 +0000 (17:55 +0100)
Lib/test/_test_multiprocessing.py
Misc/NEWS.d/next/Tests/2021-09-06-19-00-29.bpo-45052.yrOK3J.rst [new file with mode: 0644]

index 0f4e4fd910ba3245e47733b62cb887a97441b9ed..8ebcd0d64dfaa929287d640e1ab8f62f02668574 100644 (file)
@@ -3773,7 +3773,6 @@ class _TestSharedMemory(BaseTestCase):
         local_sms.buf[:len(binary_data)] = binary_data
         local_sms.close()
 
-    @unittest.skipIf(sys.platform == "win32", "test is broken on Windows")
     def test_shared_memory_basics(self):
         sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
         self.addCleanup(sms.unlink)
@@ -3792,7 +3791,6 @@ class _TestSharedMemory(BaseTestCase):
         pickled_sms = pickle.dumps(sms)
         sms2 = pickle.loads(pickled_sms)
         self.assertEqual(sms.name, sms2.name)
-        self.assertEqual(sms.size, sms2.size)
         self.assertEqual(bytes(sms.buf[0:6]), bytes(sms2.buf[0:6]), b'pickle')
 
         # Modify contents of shared memory segment through memoryview.
diff --git a/Misc/NEWS.d/next/Tests/2021-09-06-19-00-29.bpo-45052.yrOK3J.rst b/Misc/NEWS.d/next/Tests/2021-09-06-19-00-29.bpo-45052.yrOK3J.rst
new file mode 100644 (file)
index 0000000..5c2e4f3
--- /dev/null
@@ -0,0 +1,7 @@
+``WithProcessesTestSharedMemory.test_shared_memory_basics`` test was
+ignored, because ``self.assertEqual(sms.size, sms2.size)`` line was failing.
+It is now removed and test is unskipped.
+
+The main motivation for this line to be removed from the test is that the
+``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is
+decided by the platform.