1414
1515HOST = support .HOST
1616SERVER_QUIT = b'QUIT\n '
17- TIMEOUT = 3.0
1817
1918
2019class echo_server (threading .Thread ):
@@ -122,7 +121,7 @@ def line_terminator_check(self, term, server_chunk):
122121 c .push (b"I'm not dead yet!" + term )
123122 c .push (SERVER_QUIT )
124123 asyncore .loop (use_poll = self .usepoll , count = 300 , timeout = .01 )
125- support .join_thread (s , timeout = TIMEOUT )
124+ support .join_thread (s )
126125
127126 self .assertEqual (c .contents , [b"hello world" , b"I'm not dead yet!" ])
128127
@@ -153,7 +152,7 @@ def numeric_terminator_check(self, termlen):
153152 c .push (data )
154153 c .push (SERVER_QUIT )
155154 asyncore .loop (use_poll = self .usepoll , count = 300 , timeout = .01 )
156- support .join_thread (s , timeout = TIMEOUT )
155+ support .join_thread (s )
157156
158157 self .assertEqual (c .contents , [data [:termlen ]])
159158
@@ -173,7 +172,7 @@ def test_none_terminator(self):
173172 c .push (data )
174173 c .push (SERVER_QUIT )
175174 asyncore .loop (use_poll = self .usepoll , count = 300 , timeout = .01 )
176- support .join_thread (s , timeout = TIMEOUT )
175+ support .join_thread (s )
177176
178177 self .assertEqual (c .contents , [])
179178 self .assertEqual (c .buffer , data )
@@ -185,7 +184,7 @@ def test_simple_producer(self):
185184 p = asynchat .simple_producer (data + SERVER_QUIT , buffer_size = 8 )
186185 c .push_with_producer (p )
187186 asyncore .loop (use_poll = self .usepoll , count = 300 , timeout = .01 )
188- support .join_thread (s , timeout = TIMEOUT )
187+ support .join_thread (s )
189188
190189 self .assertEqual (c .contents , [b"hello world" , b"I'm not dead yet!" ])
191190
@@ -195,7 +194,7 @@ def test_string_producer(self):
195194 data = b"hello world\n I'm not dead yet!\n "
196195 c .push_with_producer (data + SERVER_QUIT )
197196 asyncore .loop (use_poll = self .usepoll , count = 300 , timeout = .01 )
198- support .join_thread (s , timeout = TIMEOUT )
197+ support .join_thread (s )
199198
200199 self .assertEqual (c .contents , [b"hello world" , b"I'm not dead yet!" ])
201200
@@ -206,7 +205,7 @@ def test_empty_line(self):
206205 c .push (b"hello world\n \n I'm not dead yet!\n " )
207206 c .push (SERVER_QUIT )
208207 asyncore .loop (use_poll = self .usepoll , count = 300 , timeout = .01 )
209- support .join_thread (s , timeout = TIMEOUT )
208+ support .join_thread (s )
210209
211210 self .assertEqual (c .contents ,
212211 [b"hello world" , b"" , b"I'm not dead yet!" ])
@@ -225,7 +224,7 @@ def test_close_when_done(self):
225224 # where the server echoes all of its data before we can check that it
226225 # got any down below.
227226 s .start_resend_event .set ()
228- support .join_thread (s , timeout = TIMEOUT )
227+ support .join_thread (s )
229228
230229 self .assertEqual (c .contents , [])
231230 # the server might have been able to send a byte or two back, but this
@@ -246,7 +245,7 @@ def test_push(self):
246245 self .assertRaises (TypeError , c .push , 'unicode' )
247246 c .push (SERVER_QUIT )
248247 asyncore .loop (use_poll = self .usepoll , count = 300 , timeout = .01 )
249- support .join_thread (s , timeout = TIMEOUT )
248+ support .join_thread (s )
250249 self .assertEqual (c .contents , [b'bytes' , b'bytes' , b'bytes' ])
251250
252251
0 commit comments