diff options
-rw-r--r-- | vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/BenchmarkingCluster.java | 4 | ||||
-rw-r--r-- | vespa-feed-client/src/test/java/ai/vespa/feed/client/impl/HttpRequestStrategyTest.java | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/BenchmarkingCluster.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/BenchmarkingCluster.java index 40049bad217..f59eee25d42 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/BenchmarkingCluster.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/BenchmarkingCluster.java @@ -74,8 +74,8 @@ public class BenchmarkingCluster implements Cluster { return getStats(); } } - catch (InterruptedException | ExecutionException ignored) { - throw new RuntimeException(ignored); + catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); } } diff --git a/vespa-feed-client/src/test/java/ai/vespa/feed/client/impl/HttpRequestStrategyTest.java b/vespa-feed-client/src/test/java/ai/vespa/feed/client/impl/HttpRequestStrategyTest.java index 13dc7ad4624..60e8c106b40 100644 --- a/vespa-feed-client/src/test/java/ai/vespa/feed/client/impl/HttpRequestStrategyTest.java +++ b/vespa-feed-client/src/test/java/ai/vespa/feed/client/impl/HttpRequestStrategyTest.java @@ -174,18 +174,20 @@ class HttpRequestStrategyTest { now.set(605000); assertEquals(OPEN, breaker.state()); // Circuit broken due to failed requests. + strategy.destroy(); + OperationStats stats = strategy.stats(); Map<Integer, Long> codes = new HashMap<>(); codes.put(200, 4L); codes.put(400, 1L); codes.put(429, 2L); codes.put(500, 3L); - assertEquals(codes, strategy.stats().responsesByCode()); - assertEquals(3, strategy.stats().exceptions()); + assertEquals(codes, stats.responsesByCode()); + assertEquals(3, stats.exceptions()); - assertEquals(strategy.stats(), strategy.stats().since(initial)); - assertEquals(0, strategy.stats().since(strategy.stats()).averageLatencyMillis()); - assertEquals(0, strategy.stats().since(strategy.stats()).requests()); - assertEquals(0, strategy.stats().since(strategy.stats()).bytesSent()); + assertEquals(stats, stats.since(initial)); + assertEquals(0, stats.since(stats).averageLatencyMillis()); + assertEquals(0, stats.since(stats).requests()); + assertEquals(0, stats.since(stats).bytesSent()); } @Test |