11package datadog .smoketest ;
22
33import static datadog .smoketest .SmokeTestUtils .buildDirectory ;
4+ import static datadog .smoketest .SmokeTestUtils .checkProcessSuccessfullyEnd ;
45import static datadog .smoketest .SmokeTestUtils .createProcessBuilder ;
5- import static org .junit .jupiter .api .Assertions .assertEquals ;
66import static org .junit .jupiter .api .Assertions .assertFalse ;
77import static org .junit .jupiter .api .Assertions .assertTrue ;
88import static org .junit .jupiter .api .Assertions .fail ;
@@ -136,9 +136,7 @@ void testReactive(Duration meanServiceTime, int arrivalRate, double minCoverage)
136136 Long .toString (arrivalRate ),
137137 Integer .toString (timeout ))
138138 .start ();
139-
140- int ret = targetProcess .waitFor ();
141- assertEquals (0 , ret );
139+ checkProcessSuccessfullyEnd (targetProcess , logFilePath );
142140
143141 long serviceRate = (long ) (workers * 1_000_000_000d ) / meanServiceTime .toNanos ();
144142 double idleness = Math .max (0d , (serviceRate - arrivalRate ) / (double ) serviceRate );
@@ -179,9 +177,7 @@ void testBatch() throws Exception {
179177 Long .toString (meanServiceTimeNs ),
180178 Integer .toString (timeout ))
181179 .start ();
182-
183- int ret = targetProcess .waitFor ();
184- assertEquals (0 , ret );
180+ checkProcessSuccessfullyEnd (targetProcess , logFilePath );
185181
186182 Files .walk (dumpDir )
187183 .filter (Files ::isRegularFile )
@@ -213,9 +209,7 @@ void testSaturatedFanout() throws Exception {
213209 Long .toString (meanServiceTimeNs ),
214210 Integer .toString (timeout ))
215211 .start ();
216-
217- int ret = targetProcess .waitFor ();
218- assertEquals (0 , ret );
212+ checkProcessSuccessfullyEnd (targetProcess , logFilePath );
219213
220214 Files .walk (dumpDir )
221215 .filter (Files ::isRegularFile )
@@ -240,9 +234,7 @@ void testNativeLibrary(String libraryName) throws Exception {
240234 logFilePath ,
241235 libraryName )
242236 .start ();
243-
244- int ret = targetProcess .waitFor ();
245- assertEquals (0 , ret );
237+ checkProcessSuccessfullyEnd (targetProcess , logFilePath );
246238
247239 Files .walk (dumpDir )
248240 .filter (Files ::isRegularFile )
@@ -287,9 +279,7 @@ private void runTestGenerativeStackTraces(String mode, int depth) throws Excepti
287279 "1000" ,
288280 mode )
289281 .start ();
290-
291- int ret = targetProcess .waitFor ();
292- assertEquals (0 , ret );
282+ checkProcessSuccessfullyEnd (targetProcess , logFilePath );
293283
294284 Files .walk (dumpDir )
295285 .filter (Files ::isRegularFile )
0 commit comments