20
20
import java .io .OutputStream ;
21
21
import java .net .InetAddress ;
22
22
import java .net .Socket ;
23
+ import java .util .concurrent .TimeUnit ;
23
24
24
25
import org .eclipse .jetty .util .thread .ShutdownThread ;
25
26
import org .junit .jupiter .api .AfterEach ;
@@ -115,7 +116,7 @@ public void testStartStopDifferentPortDifferentKey() throws Exception
115
116
monitor .start ();
116
117
117
118
stop ("stop" , port , key , true );
118
- monitor .await ();
119
+ assertTrue ( monitor .await (10 , TimeUnit . SECONDS ) );
119
120
assertTrue (!monitor .isAlive ());
120
121
121
122
// Should be able to change port and key because it is stopped.
@@ -130,7 +131,7 @@ public void testStartStopDifferentPortDifferentKey() throws Exception
130
131
assertTrue (monitor .isAlive ());
131
132
132
133
stop ("stop" , port , key , true );
133
- monitor .await ();
134
+ assertTrue ( monitor .await (5 , TimeUnit . SECONDS ) );
134
135
assertTrue (!monitor .isAlive ());
135
136
}
136
137
@@ -166,7 +167,7 @@ public void testNoExitSystemProperty() throws Exception
166
167
int port = monitor .getPort ();
167
168
168
169
stop ("stop" , port , key , true );
169
- monitor .await ();
170
+ assertTrue ( monitor .await (5 , TimeUnit . SECONDS ) );
170
171
171
172
assertTrue (!monitor .isAlive ());
172
173
assertTrue (server .stopped );
@@ -230,7 +231,7 @@ public void testForceStopCommand() throws Exception
230
231
int port = monitor .getPort ();
231
232
232
233
stop ("forcestop" , port , key , true );
233
- monitor .await ();
234
+ assertTrue ( monitor .await (5 , TimeUnit . SECONDS ) );
234
235
235
236
assertTrue (!monitor .isAlive ());
236
237
assertTrue (server .stopped );
@@ -261,7 +262,7 @@ public void testOldStopCommandWithStopOnShutdownTrue() throws Exception
261
262
int port = monitor .getPort ();
262
263
263
264
stop ("stop" , port , key , true );
264
- monitor .await ();
265
+ assertTrue ( monitor .await (5 , TimeUnit . SECONDS ) );
265
266
266
267
assertTrue (!monitor .isAlive ());
267
268
assertTrue (server .stopped );
@@ -292,7 +293,7 @@ public void testOldStopCommandWithStopOnShutdownFalse() throws Exception
292
293
int port = monitor .getPort ();
293
294
294
295
stop ("stop" , port , key , true );
295
- monitor .await ();
296
+ assertTrue ( monitor .await (5 , TimeUnit . SECONDS ) );
296
297
297
298
assertTrue (!monitor .isAlive ());
298
299
assertTrue (!server .stopped );
0 commit comments