Skip to content

Commit 49a5636

Browse files
slaunayvarun06
authored andcommitted
Fix possible faulty metrics in TestFuncProducing* (#1545)
Do not check the request-latency-in-ms metric for the cluster as it could be 0 if one of the broker is down. Similarly the response-size metric for the cluster could be recorded with 0 bytes. The respective broker metrics on the other hand are useful. Dump applicative logs from all brokers in case the tests (or something other build task) fail.
1 parent 72a629d commit 49a5636

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

functional_producer_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ func validateMetrics(t *testing.T, client Client) {
214214
metricValidators.register(minCountMeterValidator("request-rate", 3))
215215
metricValidators.register(minCountHistogramValidator("request-size", 3))
216216
metricValidators.register(minValHistogramValidator("request-size", 1))
217-
metricValidators.register(minValHistogramValidator("request-latency-in-ms", minRequestLatencyInMs))
218217
// and at least 2 requests to the registered broker (offset + produces)
219218
metricValidators.registerForBroker(broker, minCountMeterValidator("request-rate", 2))
220219
metricValidators.registerForBroker(broker, minCountHistogramValidator("request-size", 2))
@@ -248,7 +247,6 @@ func validateMetrics(t *testing.T, client Client) {
248247
// in exactly 2 global responses (metadata + offset)
249248
metricValidators.register(countMeterValidator("response-rate", 2))
250249
metricValidators.register(minCountHistogramValidator("response-size", 2))
251-
metricValidators.register(minValHistogramValidator("response-size", 1))
252250
// and exactly 1 offset response for the registered broker
253251
metricValidators.registerForBroker(broker, countMeterValidator("response-rate", 1))
254252
metricValidators.registerForBroker(broker, minCountHistogramValidator("response-size", 1))
@@ -257,7 +255,6 @@ func validateMetrics(t *testing.T, client Client) {
257255
// in at least 3 global responses (metadata + offset + produces)
258256
metricValidators.register(minCountMeterValidator("response-rate", 3))
259257
metricValidators.register(minCountHistogramValidator("response-size", 3))
260-
metricValidators.register(minValHistogramValidator("response-size", 1))
261258
// and at least 2 for the registered broker
262259
metricValidators.registerForBroker(broker, minCountMeterValidator("response-rate", 2))
263260
metricValidators.registerForBroker(broker, minCountHistogramValidator("response-size", 2))

vagrant/halt_cluster.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
#!/bin/sh
1+
#!/bin/bash
2+
3+
# If the functional tests failed (or some other task) then
4+
# we might want to look into the broker logs
5+
if [ "$TRAVIS_TEST_RESULT" = "1" ]; then
6+
echo "Dumping Kafka brokers server.log:"
7+
for i in 1 2 3 4 5; do
8+
KAFKA_PORT=`expr $i + 9090`
9+
sed -e "s/^/kafka-${KAFKA_PORT} /" ${KAFKA_INSTALL_ROOT}/kafka-${KAFKA_PORT}/logs/server.log{.*,}
10+
done
11+
fi
212

313
set -ex
414

0 commit comments

Comments
 (0)