Skip to content
Merged
Show file tree
Hide file tree
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 @@ -148,11 +148,6 @@ private QueueCapacityVector heterogeneousParser(Matcher matcher) {
}
}

// Memory always have to be defined
if (capacityVector.getMemory() == 0L) {
return new QueueCapacityVector();
}

return capacityVector;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,19 @@ public void testInvalidCapacityConfigs() {
Lists.newArrayList(nonSetCapacity.iterator());
Assert.assertEquals(nonSetResources.size(), 0);
}
}

@Test
public void testZeroAbsoluteCapacityConfig() {
QueueCapacityVector weightCapacityVector =
capacityConfigParser.parse(String.format(MEMORY_VCORE_TEMPLATE, 0, 0), QUEUE);

QueueCapacityVectorEntry memory = weightCapacityVector.getResource(MEMORY_URI);
QueueCapacityVectorEntry vcore = weightCapacityVector.getResource(VCORES_URI);

Assert.assertEquals(ResourceUnitCapacityType.ABSOLUTE, memory.getVectorResourceType());
Assert.assertEquals(0, memory.getResourceValue(), EPSILON);

Assert.assertEquals(ResourceUnitCapacityType.ABSOLUTE, vcore.getVectorResourceType());
Assert.assertEquals(0, vcore.getResourceValue(), EPSILON);
}
}