Skip to content

Commit 5c374bb

Browse files
Added check of preemptible
1 parent ce8183d commit 5c374bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tpu/src/test/java/tpu/CreateSpotTpuVmIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020
import static com.google.common.truth.Truth.assertWithMessage;
21+
import static org.junit.Assert.assertTrue;
2122

2223
import com.google.api.gax.rpc.NotFoundException;
24+
import com.google.cloud.tpu.v2.Node;
2325
import java.io.ByteArrayOutputStream;
2426
import java.io.IOException;
2527
import java.io.PrintStream;
@@ -79,6 +81,9 @@ public void testCreateSpotTpuVm() throws IOException, ExecutionException, Interr
7981
System.setOut(new PrintStream(stdOut));
8082
CreateSpotTpuVm.createSpotTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME, ACCELERATOR_TYPE, VERSION);
8183

84+
Node node = GetTpuVm.getTpuVm(PROJECT_ID, ZONE, TPU_VM_NAME);
85+
assertThat(node.getName()).isEqualTo(TPU_VM_PATH_NAME);
86+
assertTrue(node.getSchedulingConfig().getPreemptible());
8287
assertThat(stdOut.toString()).contains("TPU VM created: " + TPU_VM_PATH_NAME);
8388
stdOut.close();
8489
System.setOut(out);

0 commit comments

Comments
 (0)