Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
TetyanaYahodska committed Dec 19, 2024
1 parent 8e98108 commit b58fc0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions tpu/src/main/java/tpu/CreateTimeBoundQueuedResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ public static QueuedResource createTimeBoundQueuedResource(
.setQueuedResourceId(queuedResourceName)
.build();

// You can wait until TPU Node is READY,
// and check its status using getTpuVm() from "tpu_vm_get" sample.
return tpuClient.createQueuedResourceAsync(request).get();
}
}
Expand Down
6 changes: 4 additions & 2 deletions tpu/src/test/java/tpu/QueuedResourceIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ public void testCreateQueuedResourceWithStartupScript() throws Exception {
@Test
public void testCreateTimeBoundQueuedResource() throws Exception {
try (MockedStatic<TpuClient> mockedTpuClient = mockStatic(TpuClient.class)) {
QueuedResource mockQueuedResource = mock(QueuedResource.class);
QueuedResource mockQueuedResource = QueuedResource.newBuilder()
.setName("QueuedResourceName")
.build();
TpuClient mockTpuClient = mock(TpuClient.class);
OperationFuture mockFuture = mock(OperationFuture.class);

Expand All @@ -157,7 +159,7 @@ public void testCreateTimeBoundQueuedResource() throws Exception {
verify(mockTpuClient, times(1))
.createQueuedResourceAsync(any(CreateQueuedResourceRequest.class));
verify(mockFuture, times(1)).get();
assertEquals(returnedQueuedResource, mockQueuedResource);
assertEquals(returnedQueuedResource.getName(), mockQueuedResource.getName());
}
}
}

0 comments on commit b58fc0f

Please sign in to comment.