84 def testEndRun(self):
85 """test function"""
86 self.start()
87
88
89
90 self.send(self.input_socket, "l", identity=self.input_identity)
91 self.assertHasOutputFile("endrun_called", timeout=2)
92 self.assertIsMsgType(self.output_socket, "l", router=True)
93 self.send(self.output_socket, "c", identity=self.output_identity)
94
95
96 self.send(self.input_socket, "l", identity=self.input_identity)
97 self.assertHasOutputFile("endrun_called", timeout=1)
98 self.assertIsMsgType(self.output_socket, "l", router=True)
99 self.send(self.output_socket, "c", identity=self.output_identity)
100
101
102 self.send(self.input_socket, "u", first_data=self.first_run_event_data[0], identity=self.input_identity)
103 self.assertHasOutputFile("beginrun_called", timeout=1)
104 self.assertIsMsgType(self.output_socket, "w", router=True)
105 self.send(self.output_socket, "c", identity=self.output_identity)
106
107
108 self.send(self.input_socket, "l", identity=self.input_identity)
109 self.assertHasOutputFile("endrun_called", timeout=1)
110 self.assertIsMsgType(self.output_socket, "l", router=True)
111 self.send(self.output_socket, "c", identity=self.output_identity)
112
113
114 self.send(self.input_socket, "l", identity=self.input_identity)
115 self.assertHasOutputFile("endrun_called", timeout=1)
116 self.assertIsMsgType(self.output_socket, "l", router=True)
117 self.send(self.output_socket, "c", identity=self.output_identity)
118
119
120 self.send(self.input_socket, "u", first_data=self.second_run_event_data[0], identity=self.input_identity)
121 self.assertHasOutputFile("beginrun_called", timeout=1)
122 self.assertIsMsgType(self.output_socket, "w", router=True)
123 self.send(self.output_socket, "c", identity=self.output_identity)
124
125
126 self.send(self.input_socket, "l", identity=self.input_identity)
127 self.assertHasOutputFile("endrun_called", timeout=1)
128 self.assertIsMsgType(self.output_socket, "l", router=True)
129 self.send(self.output_socket, "c", identity=self.output_identity)
130
131
132 self.send(self.input_socket, "x", identity=self.input_identity)
133
134 self.assertIsMsgType(self.output_socket, "x", router=True)
135 self.send(self.output_socket, "c", identity=self.output_identity)
136 self.assertHasOutputFile("terminate_called", timeout=1)
137
138
139 self.assertIsDown("worker", timeout=200)
140
141