yoda-mon commented on code in PR #922:
URL: https://github.com/apache/bigtop/pull/922#discussion_r912746636
##########
bigtop-tests/smoke-tests/kafka/TestKafkaSmoke.groovy:
##########
@@ -44,9 +51,27 @@ class TestKafkaSmoke {
}
@Test
- public void testCreateTopics() {
+ public void test0CreateTopics() {
sh.exec(KAFKA_TOPICS + " --create --zookeeper localhost:2181
--replication-factor 1 --partitions 1 --topic test");
sh.exec(KAFKA_TOPICS + " --list --zookeeper localhost:2181");
assertTrue(" Create Kafka topics failed. " + sh.getOut() + " " +
sh.getErr(), sh.getRet() == 0);
}
+
+ @Test
+ public void test1WriteKafkaTopics() {
+ sh.exec("echo '" + TEST_MESSAGE + "' | " + KAFKA_PRODUCER + "
--broker-list localhost:9092 --topic test");
+ assertTrue(
+ " Write Kafka topics failed. " + sh.getOut() + " " + sh.getErr(),
+ sh.getRet() == 0
+ );
+ }
+
+ @Test
+ public void test2ReadKafkaTopics() {
+ sh.exec(KAFKA_CONSUMER + " --bootstrap-server localhost:9092 --topic test
--partition 0 --offset 0 --max-messages 1");
Review Comment:
I added `--timeout-ms 10000` to the consumer test and it passed the test.
On my environment, 100 ms failed and 1000 ms passed the test, so I set 10
times lager value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]