File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
main/java/org/jenkinsci/plugins/workflow/cps
test/java/org/jenkinsci/plugins/workflow/cps Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 240240 </exclusion >
241241 </exclusions >
242242 </dependency >
243+ <dependency >
244+ <groupId >org.awaitility</groupId >
245+ <artifactId >awaitility</artifactId >
246+ <version >4.2.2</version >
247+ <scope >test</scope >
248+ </dependency >
243249 </dependencies >
244250 <build >
245251 <resources >
Original file line number Diff line number Diff line change @@ -1676,7 +1676,7 @@ public static void suspendAll() {
16761676 if (cpsExec .programPromise != null ) {
16771677 cpsExec .runInCpsVmThread (new FutureCallback <>() {
16781678 @ Override public void onSuccess (CpsThreadGroup g ) {
1679- LOGGER .fine (() -> "shutting down CPS VM threadin for " + cpsExec );
1679+ LOGGER .fine (() -> "shutting down CPS VM for " + cpsExec );
16801680 g .shutdown ();
16811681 }
16821682 @ Override public void onFailure (Throwable t ) {
Original file line number Diff line number Diff line change 7373import java .util .stream .Collectors ;
7474import jenkins .model .Jenkins ;
7575import org .apache .commons .io .FileUtils ;
76+ import static org .awaitility .Awaitility .await ;
7677import static org .hamcrest .MatcherAssert .assertThat ;
7778import static org .hamcrest .Matchers .arrayContaining ;
7879import static org .hamcrest .Matchers .contains ;
@@ -207,6 +208,7 @@ private static List<String> stepNames(ListenableFuture<List<StepExecution>> exec
207208
208209 @ Test public void iterateAfterSuspend () throws Throwable {
209210 sessions .then (r -> {
211+ logger .record (CpsFlowExecution .class , Level .FINE );
210212 WorkflowJob p = r .jenkins .createProject (WorkflowJob .class , "iterateAfterSuspend" );
211213 p .setDefinition (new CpsFlowDefinition ("semaphore 'wait'" , true ));
212214 SemaphoreStep .waitForStart ("wait/1" , p .scheduleBuild2 (0 ).waitForStart ());
@@ -226,7 +228,7 @@ private static List<String> stepNames(ListenableFuture<List<StepExecution>> exec
226228 return ; // different test
227229 }
228230 try {
229- assertThat ( p .getLastBuild ().getExecution ().getCurrentExecutions (false ).get (), empty ());
231+ await (). until (() -> p .getLastBuild ().getExecution ().getCurrentExecutions (false ).get (), empty ());
230232 } catch (Throwable t ) {
231233 iterateAfterSuspendError .set (t );
232234 }
You can’t perform that action at this time.
0 commit comments