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 @@ -1584,20 +1584,24 @@ public void testGetRunningContainersToKill() {
node.getContainersToKill());
}

private static long LAST_TIMESTAMP = 0L;
private static RMContainer newMockRMContainer(boolean isAMContainer,
ExecutionType executionType, String name) {
long now = Time.now();
while (now <= LAST_TIMESTAMP) { now = Time.now(); }
LAST_TIMESTAMP = now;
RMContainer container = mock(RMContainer.class);
when(container.isAMContainer()).thenReturn(isAMContainer);
when(container.getExecutionType()).thenReturn(executionType);
when(container.getCreationTime()).thenReturn(Time.now());
when(container.getCreationTime()).thenReturn(now);
when(container.toString()).thenReturn(name);
return container;
}

/**
* SchedulerNode mock to test launching containers.
*/
class MockSchedulerNode extends SchedulerNode {
static class MockSchedulerNode extends SchedulerNode {
private final List<RMContainer> containers = new ArrayList<>();

MockSchedulerNode() {
Expand Down
Loading