@@ -133,10 +133,14 @@ public static boolean waitForJobs(String owner, long minTimeMs, long maxTimeMs)
133133 * @return true if the method timed out, false if all the jobs terminated before the timeout
134134 */
135135 public static boolean waitForJobs (String owner , long minTimeMs , long maxTimeMs , Object ... excludedFamilies ) {
136+ return waitForJobs (owner , null , minTimeMs , maxTimeMs , excludedFamilies );
137+ }
138+
139+ public static boolean waitForJobs (String owner , Object jobFamily , long minTimeMs , long maxTimeMs , Object ... excludedFamilies ) {
136140 if (maxTimeMs < minTimeMs ) {
137141 throw new IllegalArgumentException ("Max time is smaller as min time!" );
138142 }
139- wakeUpSleepingJobs (null );
143+ wakeUpSleepingJobs (jobFamily );
140144 final long startNanos = System .nanoTime ();
141145 while (System .nanoTime () - startNanos < minTimeMs * 1_000_000L ) {
142146 runEventLoop ();
@@ -153,7 +157,7 @@ public static boolean waitForJobs(String owner, long minTimeMs, long maxTimeMs,
153157 } catch (InterruptedException e ) {
154158 // Uninterruptable
155159 }
156- List <Job > jobs = getRunningOrWaitingJobs (null , excludedFamilies );
160+ List <Job > jobs = getRunningOrWaitingJobs (jobFamily , excludedFamilies );
157161 if (jobs .isEmpty ()) {
158162 // only uninteresting jobs running
159163 break ;
@@ -169,7 +173,7 @@ public static boolean waitForJobs(String owner, long minTimeMs, long maxTimeMs,
169173 dumpRunningOrWaitingJobs (owner , jobs );
170174 return true ;
171175 }
172- wakeUpSleepingJobs (null );
176+ wakeUpSleepingJobs (jobFamily );
173177 }
174178 runningJobs .clear ();
175179 return false ;
0 commit comments