From 1ff5ef905554b9f31b762ae8336f3c85f3691d95 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Mon, 4 Dec 2017 14:14:45 -0700 Subject: [PATCH] [TEST] Check accounting breaker is equal to segment stats rather than 0 If there are existing indices, it may not be 0 --- .../java/org/elasticsearch/test/ExternalTestCluster.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/ExternalTestCluster.java b/test/framework/src/main/java/org/elasticsearch/test/ExternalTestCluster.java index 5eb34d96d69..90d58786496 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ExternalTestCluster.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ExternalTestCluster.java @@ -168,8 +168,10 @@ public final class ExternalTestCluster extends TestCluster { for (NodeStats stats : nodeStats.getNodes()) { assertThat("Fielddata breaker not reset to 0 on node: " + stats.getNode(), stats.getBreaker().getStats(CircuitBreaker.FIELDDATA).getEstimated(), equalTo(0L)); - assertThat("Accounting breaker not reset to 0 on node: " + stats.getNode(), - stats.getBreaker().getStats(CircuitBreaker.ACCOUNTING).getEstimated(), equalTo(0L)); + assertThat("Accounting breaker not reset to " + stats.getIndices().getSegments().getMemoryInBytes() + + " on node: " + stats.getNode(), + stats.getBreaker().getStats(CircuitBreaker.ACCOUNTING).getEstimated(), + equalTo(stats.getIndices().getSegments().getMemoryInBytes())); // ExternalTestCluster does not check the request breaker, // because checking it requires a network request, which in // turn increments the breaker, making it non-0