Skip to content

Commit

Permalink
fix: removes unneeded test, extends timeout (#9841)
Browse files Browse the repository at this point in the history
* fix: removes unneeded test, extends timeout

* marking tests as Ignore
  • Loading branch information
telpirion authored Dec 11, 2024
1 parent 66f1c62 commit 9b219c0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 74 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down Expand Up @@ -135,6 +136,7 @@ private static void safeDeleteJob(String jobName) {
}
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createBatchCustomServiceAccountTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -148,6 +150,7 @@ public void createBatchCustomServiceAccountTest()
Assert.assertNotNull(job.getAllocationPolicy().getServiceAccount().getEmail());
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createBatchUsingSecretManager()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -164,6 +167,7 @@ public void createBatchUsingSecretManager()
-> taskGroup.getTaskSpec().getEnvironment().containsSecretVariables(variableName)));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createGpuJobTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -181,6 +185,7 @@ public void createGpuJobTest()
-> instance.getPolicy().getMachineType().contains(machineType)));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createGpuJobN1Test()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -199,6 +204,7 @@ public void createGpuJobN1Test()
-> accelerator.getType().contains(gpuType) && accelerator.getCount() == count)));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createLocalSsdJobTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -217,6 +223,7 @@ public void createLocalSsdJobTest()
-> attachedDisk.getDeviceName().contains(LOCAL_SSD_NAME))));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createPersistentDiskJobTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -243,6 +250,7 @@ public void createPersistentDiskJobTest()
-> attachedDisk.getDeviceName().contains(NEW_PERSISTENT_DISK_NAME))));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createBatchNotificationTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -263,6 +271,7 @@ public void createBatchNotificationTest()
&& jobNotification.getMessage().getNewTaskState() == State.FAILED));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createBatchCustomEventTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -284,6 +293,7 @@ public void createBatchCustomEventTest()
.anyMatch(runnable -> runnable.getDisplayName().equals(displayName))));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createScriptJobWithNfsTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -303,6 +313,7 @@ public void createScriptJobWithNfsTest()
.anyMatch(volume -> volume.getNfs().getServer().equals(NFS_IP_ADDRESS))));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createBatchLabelJobTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -324,6 +335,7 @@ public void createBatchLabelJobTest()
Assert.assertTrue(job.getLabelsMap().containsValue(labelValue2));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createBatchCustomNetworkTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -346,6 +358,7 @@ public void createBatchCustomNetworkTest()
.anyMatch(AllocationPolicy.NetworkInterface::getNoExternalIpAddress));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createJobWithAllocationPolicyLabelTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand All @@ -368,6 +381,7 @@ public void createJobWithAllocationPolicyLabelTest()
Assert.assertTrue(job.getAllocationPolicy().getLabelsMap().containsValue(labelValue2));
}

@Ignore("Canceling jobs not yet GA")
@Test
public void createBatchRunnableLabelTest()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
Expand Down
2 changes: 1 addition & 1 deletion batch/snippets/src/test/java/com/example/batch/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static void waitForJobCompletion(Job job)
String[] jobName = job.getName().split("/");
Instant startTime = Instant.now();
while (WAIT_STATES.contains(job.getStatus().getState())) {
if (Instant.now().getEpochSecond() - startTime.getEpochSecond() > 900) {
if (Instant.now().getEpochSecond() - startTime.getEpochSecond() > 1200) {
throw new Error("Timed out waiting for operation to complete.");
}
job = getJob(jobName[1], jobName[3], jobName[5]);
Expand Down

0 comments on commit 9b219c0

Please sign in to comment.