Skip to content

Commit

Permalink
Poll for pod creation in testProvisionCreateThenTerminatePod
Browse files Browse the repository at this point in the history
  • Loading branch information
longngn committed Aug 19, 2019
1 parent cc0c63c commit 90bf6c3
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ public void testProvisionCreateThenTerminatePod() throws Exception {
PodResource<Pod, DoneablePod> pod = k.getClient().pods().inNamespace(cloud.getNamespace()).withName(slave.getNodeName());

assertNull(pod.get());

// Poll for pod creation
j.jenkins.addNode(slave);
TimeUnit.SECONDS.sleep(20);
final int TIMEOUT = 30;
for(int i = 0; i < TIMEOUT; i++) {
if (pod.get() != null) break;
TimeUnit.SECONDS.sleep(1);
}
assertNotNull(pod.get());

slave._terminate(listener);
assertNull(pod.get());
}
Expand Down

0 comments on commit 90bf6c3

Please sign in to comment.