The test test_multiprocessing_shared_memory_disabled asserts that ENOSYS occurs. This comes from SHM_GET_NAME which comes from shm_open which comes from here in CPython. This works with Debian Bullseye which is on glibc 2.31.
However, in glibc 2.34, behaviour of shm_openwas changed to no longer return ENOSYS. With Debian Bookworm, which is on glibc 2.36, this test fails with ENOENT instead:
======================================================================
FAIL: test_multiprocessing_shared_memory_disabled (tests.test_nsjail.NsJailTests.test_multiprocessing_shared_memory_disabled)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/snekbox/tests/test_nsjail.py", line 366, in test_multiprocessing_shared_memory_disabled
self.assertIn("Function not implemented", result.stdout)
AssertionError: 'Function not implemented' not found in 'Traceback (most recent call last):\n File "/home/test.py", line 3, in <module>\n SharedMemory(\'test\', create=True, size=16)\n File "/usr/local/lib/python3.11/multiprocessing/shared_memory.py", line 104, in __init__\n self._fd = _posixshmem.shm_open(\n ^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory: \'/test\'\n'
Update the test to assert either ENOSYS or ENOENT is raised (support both scenarios). Alternatively, come up with a way to test this that isn't tied to glibc behaviour.
The test
test_multiprocessing_shared_memory_disabled
asserts thatENOSYS
occurs. This comes fromSHM_GET_NAME
which comes fromshm_open
which comes from here in CPython. This works with Debian Bullseye which is on glibc 2.31.However, in glibc 2.34, behaviour of
shm_open
was changed to no longer returnENOSYS
. With Debian Bookworm, which is on glibc 2.36, this test fails withENOENT
instead:Update the test to assert either
ENOSYS
orENOENT
is raised (support both scenarios). Alternatively, come up with a way to test this that isn't tied to glibc behaviour.