MCPcopy Index your code
hub / github.com/python/cpython / test_remote

Method test_remote

Lib/test/_test_multiprocessing.py:3544–3570  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3542 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
3543 @support.skip_if_sanitizer('TSan: leaks threads', thread=True)
3544 def test_remote(self):
3545 authkey = os.urandom(32)
3546
3547 manager = QueueManager(
3548 address=(socket_helper.HOST, 0), authkey=authkey, serializer=SERIALIZER,
3549 shutdown_timeout=SHUTDOWN_TIMEOUT)
3550 manager.start()
3551 self.addCleanup(manager.shutdown)
3552
3553 p = self.Process(target=self._putter, args=(manager.address, authkey))
3554 p.daemon = True
3555 p.start()
3556
3557 manager2 = QueueManager2(
3558 address=manager.address, authkey=authkey, serializer=SERIALIZER,
3559 shutdown_timeout=SHUTDOWN_TIMEOUT)
3560 manager2.connect()
3561 queue = manager2.get_queue()
3562
3563 self.assertEqual(queue.get(), self.result)
3564
3565 # Because we are using xmlrpclib for serialization instead of
3566 # pickle this will cause a serialization error.
3567 self.assertRaises(Exception, queue.put, time.sleep)
3568
3569 # Make queue finalizer run before the server is stopped
3570 del queue
3571
3572
3573@hashlib_helper.requires_hashdigest('sha256')

Callers

nothing calls this directly

Calls 9

QueueManagerClass · 0.85
QueueManager2Class · 0.85
addCleanupMethod · 0.80
startMethod · 0.45
ProcessMethod · 0.45
connectMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected