|
37 | 37 | import java.lang.reflect.Field; |
38 | 38 | import java.util.Collections; |
39 | 39 | import java.util.logging.Level; |
| 40 | +import java.util.logging.Logger; |
40 | 41 | import java.util.stream.Collectors; |
41 | 42 | import static jenkins.branch.NoTriggerBranchPropertyTest.showComputation; |
42 | 43 | import jenkins.branch.harness.MultiBranchImpl; |
|
57 | 58 |
|
58 | 59 | public class WorkspaceLocatorImplTest { |
59 | 60 |
|
| 61 | + private static final Logger LOGGER = Logger.getLogger(WorkspaceLocatorImplTest.class.getName()); |
| 62 | + |
60 | 63 | @ClassRule |
61 | 64 | public static BuildWatcher buildWatcher = new BuildWatcher(); |
62 | 65 | @Rule |
@@ -218,19 +221,23 @@ public void delete() throws Exception { |
218 | 221 | @Issue("JENKINS-2111") |
219 | 222 | @Test |
220 | 223 | public void deleteOffline() throws Exception { |
221 | | - assumeFalse("TODO: Fails on Windows CI runs", Functions.isWindows() && System.getenv("CI") != null); |
| 224 | + assumeFalse("TODO observed to fail on Windows https://github.com/jenkinsci/branch-api-plugin/runs/45521728008", Functions.isWindows() && System.getenv("CI") != null); |
222 | 225 | WorkspaceLocatorImpl.MODE = WorkspaceLocatorImpl.Mode.ENABLED; |
223 | 226 | FreeStyleProject p = r.createFreeStyleProject("a'b"); |
| 227 | + LOGGER.info("building project on agent"); |
224 | 228 | DumbSlave s = r.createSlave("remote", null, null); |
225 | 229 | p.setAssignedNode(s); |
226 | 230 | assertEquals(s, r.buildAndAssertSuccess(p).getBuiltOn()); |
227 | 231 | assertEquals(Collections.singletonList("a_b"), s.getWorkspaceRoot().listDirectories().stream().map(FilePath::getName).collect(Collectors.toList())); |
228 | 232 | s.getWorkspaceRoot().child(WorkspaceLocatorImpl.INDEX_FILE_NAME).copyTo(System.out); |
229 | | - s.toComputer().disconnect(null); |
| 233 | + LOGGER.info("disconnecting agent"); |
| 234 | + s.toComputer().disconnect(null).get(); |
230 | 235 | p.delete(); |
231 | 236 | s = (DumbSlave) r.jenkins.getNode("remote"); |
| 237 | + LOGGER.info("reconnecting agent"); |
232 | 238 | s.toComputer().connect(true).get(); |
233 | 239 | assertEquals(Collections.emptyList(), s.getWorkspaceRoot().listDirectories()); |
| 240 | + LOGGER.info("displaying launch log"); |
234 | 241 | s.toComputer().getLogText().writeLogTo(0, System.out); |
235 | 242 | } |
236 | 243 |
|
|
0 commit comments