Improve reproducability of RestControllerTests

With this commit we use the classic parent circuit breaker which does
not account for real memory usage. In those tests we want to have
reproducible results and hence it makes sense to disable the real memory
circuit breaker there.
This commit is contained in:
Daniel Mitterdorfer 2018-09-06 09:42:45 +02:00
parent a721d09c81
commit 5236f2b1af
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,8 @@ public class RestControllerTests extends ESTestCase {
circuitBreakerService = new HierarchyCircuitBreakerService(
Settings.builder()
.put(HierarchyCircuitBreakerService.IN_FLIGHT_REQUESTS_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), BREAKER_LIMIT)
// We want to have reproducible results in this test, hence we disable real memory usage accounting
.put(HierarchyCircuitBreakerService.USE_REAL_MEMORY_USAGE_SETTING.getKey(), false)
.build(),
new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
usageService = new UsageService(settings);