Open twegener-embertec opened 2 years ago
The following patch for the test makes the Exception thrown during exception handling
errors go away, but I don't know whether this is an appropriate change. I just followed the pattern seen in some other tests in that file, but I also noticed some other tests that don't have the NettyMocks.mockChannelFuture(query);
call and yet don't run into this problem.
diff --git a/test/tsd/TestQueryRpc.java b/test/tsd/TestQueryRpc.java
index f9f855a3..b8241580 100644
--- a/test/tsd/TestQueryRpc.java
+++ b/test/tsd/TestQueryRpc.java
@@ -514,6 +514,7 @@ public final class TestQueryRpc {
"{\"start\":1425440315306,\"queries\":" +
"[{\"metric\":\"nonexistent\",\"aggregator\":\"sum\",\"rate\":true," +
"\"rateOptions\":{\"counter\":false}}]}");
+ NettyMocks.mockChannelFuture(query);
rpc.execute(tsdb, query);
assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus());
final String json =
@@ -575,6 +576,7 @@ public final class TestQueryRpc {
final HttpQuery query = NettyMocks.getQuery(tsdb,
"/api/query?start=1h-ago&m=sum:sys.cpu.user");
+ NettyMocks.mockChannelFuture(query);
rpc.execute(tsdb, query);
assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus());
final String json =
@@ -673,6 +675,7 @@ public final class TestQueryRpc {
final HttpQuery query = NettyMocks.getQuery(tsdb,
"/api/query/gexp?start=1h-ago&exp=scale(sum:sys.cpu.user,notanumber)");
+ NettyMocks.mockChannelFuture(query);
rpc.execute(tsdb, query);
assertEquals(query.response().getStatus(), HttpResponseStatus.BAD_REQUEST);
final String json =
When running make check-local the following unit tests give the error
QueryRpc: Exception thrown during exception handling
even though they otherwise pass. This is annoying and confusing since it makes it hard to tell whether these are real problems with exception reporting.This issue may have been around for ages, but it seems like it would be worth fixing, or if unavoidable, then at least having a comment in the test code saying so and why.