148 def testUnregistration(self):
149 """test function"""
150 self.start()
151
152
153 for _ in range(10):
154 self.send(self.input_socket, "u", first_data=self.event_data, identity=self.input_identity)
155 self.assertIsMsgType(self.output_socket, "w", router=True)
156 self.send(self.output_socket, "c", identity=self.output_identity)
157
158 self.assertHasOutputFile("dying_beginrun_called", timeout=1)
159
160
161 Path("dying_exit_request").touch()
162
163 self.send(self.input_socket, "u", first_data=self.event_data, identity=self.input_identity)
164 self.assertHasOutputFile("dying_exit_called", timeout=1)
165 msg = self.assertIsMsgType(self.output_socket, "d", router=True)
166
167 self.assertEqual(msg[2].decode(), self.output_identity)
168 self.send(self.output_socket, "c", identity=msg[0].decode())
169
170 self.assertIsDown("worker", timeout=10)
171
172