Skip to content

Commit f0b8314

Browse files
Added timeout
1 parent 9ee20d7 commit f0b8314

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tpu/src/test/java/tpu/TpuVmIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void testCreateTpuVm() throws IOException, ExecutionException, Interrupte
9696
ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
9797
System.setOut(new PrintStream(stdOut));
9898
CreateTpuVm.createTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME, ACCELERATOR_TYPE, VERSION);
99+
TimeUnit.MINUTES.sleep(3);
99100

100101
assertThat(stdOut.toString()).contains("TPU VM created: " + TPU_VM_PATH_NAME);
101102
stdOut.close();
@@ -106,6 +107,7 @@ public void testCreateTpuVm() throws IOException, ExecutionException, Interrupte
106107
@Order(2)
107108
public void testGetTpuVm() throws IOException {
108109
Node node = GetTpuVm.getTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME);
110+
109111
assertNotNull(node);
110112
assertThat(node.getName()).isEqualTo(TPU_VM_PATH_NAME);
111113
}
@@ -114,6 +116,7 @@ public void testGetTpuVm() throws IOException {
114116
@Order(2)
115117
public void testListTpuVm() throws IOException {
116118
TpuClient.ListNodesPagedResponse nodesList = ListTpuVms.listTpuVms(PROJECT_ID, ZONE);
119+
117120
assertNotNull(nodesList);
118121
for (Node node : nodesList.iterateAll()) {
119122
Assert.assertTrue(node.getName().contains("test-tpu"));
@@ -125,6 +128,7 @@ public void testListTpuVm() throws IOException {
125128
public void testStopTpuVm() throws IOException, ExecutionException, InterruptedException {
126129
StopTpuVm.stopTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME);
127130
Node node = GetTpuVm.getTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME);
131+
128132
assertThat(node.getState()).isEqualTo(STOPPED);
129133
}
130134

@@ -133,6 +137,7 @@ public void testStopTpuVm() throws IOException, ExecutionException, InterruptedE
133137
public void testStartTpuVm() throws IOException, ExecutionException, InterruptedException {
134138
StartTpuVm.startTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME);
135139
Node node = GetTpuVm.getTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME);
140+
136141
assertThat(node.getState()).isEqualTo(READY);
137142
}
138143

0 commit comments

Comments
 (0)