Reduce potential memory usage in TestMemoryManager
@@ -294,19 +294,20 @@ public class TestMemoryManager
.anyMatch(task -> task.getBlockedReasons().contains(WAITING_FOR_MEMORY));
}
- @Test(timeOut = 240_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Query exceeded max memory size of 1kB.*")
+ @Test(timeOut = 60_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Query exceeded max memory size of 1kB.*")
public void testQueryMemoryLimit()
throws Exception
{
Map<String, String> properties = ImmutableMap.<String, String>builder()
+ .put("task.max-partial-aggregation-memory", "1B")
.put("query.max-memory", "1kB")
.build();
try (QueryRunner queryRunner = createQueryRunner(SESSION, properties)) {
- queryRunner.execute(SESSION, "SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
+ queryRunner.execute(SESSION, "SELECT COUNT(*), repeat(orderstatus, 1000) FROM orders GROUP BY 2");
}
}
- @Test(timeOut = 240_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = "Exceeded CPU limit of .*")
+ @Test(timeOut = 60_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = "Exceeded CPU limit of .*")
public void testQueryCpuLimit()
throws Exception
{
@@ -314,20 +315,20 @@ public class TestMemoryManager
.put("query.max-cpu-time", "1ms")
.build();
try (QueryRunner queryRunner = createQueryRunner(SESSION, properties)) {
- // the following test query is known to run for a long time
- queryRunner.execute(SESSION, "SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
+ queryRunner.execute(SESSION, "SELECT COUNT(*), repeat(orderstatus, 1000) FROM orders GROUP BY 2");
}
}
- @Test(timeOut = 240_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Query exceeded local memory limit of 1kB.*")
+ @Test(timeOut = 60_000, expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Query exceeded local memory limit of 1kB.*")
public void testQueryMemoryPerNodeLimit()
throws Exception
{
Map<String, String> properties = ImmutableMap.<String, String>builder()
+ .put("task.max-partial-aggregation-memory", "1B")
.put("query.max-memory-per-node", "1kB")
.build();
try (QueryRunner queryRunner = createQueryRunner(SESSION, properties)) {
- queryRunner.execute(SESSION, "SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
+ queryRunner.execute(SESSION, "SELECT COUNT(*), repeat(orderstatus, 1000) FROM orders GROUP BY 2");
}
}
