summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_multiprocessing.py
diff options
context:
space:
mode:
authorJesse Noller <jnoller@gmail.com>2009-03-30 15:50:42 (GMT)
committerJesse Noller <jnoller@gmail.com>2009-03-30 15:50:42 (GMT)
commit459a6481662c62d6cb57a070d21230db3e721c56 (patch)
treef7d547008e124f2eacc48db47dc346947b4d944a /Lib/test/test_multiprocessing.py
parent5cb104d1b936da539b41eddc21fa56f74909e0b6 (diff)
downloadcpython-459a6481662c62d6cb57a070d21230db3e721c56.zip
cpython-459a6481662c62d6cb57a070d21230db3e721c56.tar.gz
cpython-459a6481662c62d6cb57a070d21230db3e721c56.tar.bz2
Issue 5177: use socket.SO_REUSEADDR on multiprocessing SocketManager sockets
Diffstat (limited to 'Lib/test/test_multiprocessing.py')
-rw-r--r--Lib/test/test_multiprocessing.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 8f34a1e..76bd3ed 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1189,6 +1189,30 @@ class _TestRemoteManager(BaseTestCase):
del queue
manager.shutdown()
+class _TestManagerRestart(BaseTestCase):
+
+ def _putter(self, address, authkey):
+ manager = QueueManager(
+ address=address, authkey=authkey, serializer=SERIALIZER)
+ manager.connect()
+ queue = manager.get_queue()
+ queue.put('hello world')
+
+ def test_rapid_restart(self):
+ authkey = os.urandom(32)
+ manager = QueueManager(
+ address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
+ manager.start()
+
+ p = self.Process(target=self._putter, args=(manager.address, authkey))
+ p.start()
+ queue = manager.get_queue()
+ self.assertEqual(queue.get(), 'hello world')
+ manager.shutdown()
+ manager = QueueManager(
+ address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
+ manager.start()
+
#
#
#