[issue36867] Make semaphore_tracker track other system resources

STINNER Victor report at bugs.python.org
Mon May 13 06:58:46 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

test_shared_memory_cleaned_after_process_termination() uses time as a weak synchronization primitive:


        # killing abruptly processes holding reference to a shared memory
        # segment should not leak the given memory segment.
        p.terminate()
        p.wait()
        time.sleep(1.0)  # wait for the OS to collect the segment

        with self.assertRaises(FileNotFoundError):
            smm = shared_memory.SharedMemory(name, create=False)

Would it be possible to use a more reliable synchronization? Such test usually fail randomly.
https://pythondev.readthedocs.io/unstable_tests.html

----------
nosy: +vstinner

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36867>
_______________________________________


More information about the Python-bugs-list mailing list