De-flake `BuildCommandTest#executorsAliveOnParameterWithNullDefaultValue`
@@ -26,6 +26,7 @@ package hudson.cli;
import static hudson.cli.CLICommandInvoker.Matcher.failedWith;
import static hudson.cli.CLICommandInvoker.Matcher.succeeded;
+import static org.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString;
@@ -62,6 +63,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import net.sf.json.JSONObject;
import org.junit.ClassRule;
import org.junit.Rule;
@@ -241,7 +243,9 @@ public class BuildCommandTest {
j.buildAndAssertSuccess(project);
for (Executor exec : slave.toComputer().getExecutors()) {
- assertTrue("Executor has died before the test start: " + exec, exec.isActive());
+ await().pollInterval(250, TimeUnit.MILLISECONDS)
+ .atMost(10, TimeUnit.SECONDS)
+ .until(exec::isActive);
}
// Create CLI & run command
