Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Stream;

import static com.phonepe.drove.executor.ExecutorTestingUtils.DOCKER_CLIENT;
Expand Down Expand Up @@ -65,7 +66,7 @@ void testContainerCreate(
when(resourceManager.currentState())
.thenReturn(new ResourceInfo(null, null,
new PhysicalLayout(Map.of(0, Set.of(0, 1, 2, 3)), Map.of(0, 1024L))));
val httpCaller = mock(HttpCaller.class);
pullImage(spec);
val containerId = DockerUtils.createContainer(
resourceConfig,
DOCKER_CLIENT,
Expand All @@ -91,6 +92,7 @@ void testContainerRun() {
val httpCaller = mock(HttpCaller.class);
Comment thread
santanusinha marked this conversation as resolved.
val spec = ExecutorTestingUtils.testTaskInstanceSpec()
.withEnv(Map.of("ITERATIONS", "10000", "LOOP_SLEEP", "5"));
pullImage(spec);
val containerId = DockerUtils.createContainer(
ResourceConfig.DEFAULT,
DOCKER_CLIENT,
Expand All @@ -114,6 +116,17 @@ void testContainerRun() {
}
}

private static void pullImage(TaskInstanceSpec spec) {
try {
val imageId = DockerUtils.pullImage(DOCKER_CLIENT, null, spec, Function.identity());
Comment thread
santanusinha marked this conversation as resolved.
assertNotNull(DOCKER_CLIENT.inspectImageCmd(imageId).exec());
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
Assertions.fail("Pull Interrupted", e);
}
}

private static Stream<Arguments> generateResourceConfigs() {
val spec = testTaskInstanceSpec();
val defaultConfig = ResourceConfig.DEFAULT;
Expand Down