Repository: flink Updated Branches: refs/heads/master 6f5fa7f74 -> 2ed74ca06
[FLINK-7300] Fix unstable Kafka end-to-end tests Instead of specifying a timeout for the console consumer we now speciy an uppper message boundary that matches our expected number of messages. The timout was to unstable because it could sometimes return even though messages were in fact available. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/65402e03 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/65402e03 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/65402e03 Branch: refs/heads/master Commit: 65402e034c32e47824fe46427d83eb9c9ea22d30 Parents: 6f5fa7f Author: Aljoscha Krettek <aljoscha.kret...@gmail.com> Authored: Mon Aug 7 18:08:03 2017 +0200 Committer: Aljoscha Krettek <aljoscha.kret...@gmail.com> Committed: Tue Aug 8 13:53:18 2017 +0200 ---------------------------------------------------------------------- .../end-to-end-test/test_streaming_kafka010.sh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/65402e03/test-infra/end-to-end-test/test_streaming_kafka010.sh ---------------------------------------------------------------------- diff --git a/test-infra/end-to-end-test/test_streaming_kafka010.sh b/test-infra/end-to-end-test/test_streaming_kafka010.sh index f358e24..cce8db4 100755 --- a/test-infra/end-to-end-test/test_streaming_kafka010.sh +++ b/test-infra/end-to-end-test/test_streaming_kafka010.sh @@ -73,24 +73,7 @@ $FLINK_DIR/bin/flink run -d build-target/examples/streaming/Kafka010Example.jar # send some data to Kafka echo -e "hello\nwhats\nup" | $KAFKA_DIR/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test-input -# wait at most (roughly) 5 minutes until the results are there -for i in {1..300}; do - DATA_FROM_KAFKA=$($KAFKA_DIR/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test-output --from-beginning --timeout-ms 0 2> /dev/null) - - # make sure we have actual newlines in the string, not "\n" - EXPECTED=$(printf "PREFIX:hello\nPREFIX:whats\nPREFIX:up") - - if [[ "$DATA_FROM_KAFKA" == "$EXPECTED" ]]; then - echo -e "Retrieved data from Kafka: --$DATA_FROM_KAFKA--" - break - fi - - echo "Waiting for results from Kafka..." - sleep 1 -done - -# verify again to set the PASS variable -DATA_FROM_KAFKA=$($KAFKA_DIR/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test-output --from-beginning --timeout-ms 0 2> /dev/null) +DATA_FROM_KAFKA=$($KAFKA_DIR/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test-output --from-beginning --max-messages 3 2> /dev/null) # make sure we have actual newlines in the string, not "\n" EXPECTED=$(printf "PREFIX:hello\nPREFIX:whats\nPREFIX:up")