miguno/kafka-storm-starter

Test suit doesn't pass

daveroberts opened this issue · 6 comments

Running on a Vagrant ubuntu/trusty64 box with OpenJDK 1.7.0_79.

Some output truncated:

[info]   + Then the local cluster should start properly 
2015-09-23 17:19:58 backtype.storm.testing4j [ERROR] Error in cluster
java.lang.AssertionError: Test timed out (5000ms)
    at backtype.storm.testing$wait_until_cluster_waiting.invoke(testing.clj:213) ~[storm-core-0.9.3.jar:0.9.3]
...
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
[info] - should run a basic topology *** FAILED ***
[info]   java.lang.AssertionError: Test timed out (5000ms)
...
at com.miguno.kafkastorm.integration.StormSpec$$anonfun$1$$anonfun$apply$mcV$sp$2$$anon$2.run(StormSpec.scala:81)
[info]   ...
[info]   + Given a local cluster
...

This may happen if the performance of your VM is not fast enough -- Storm by default has a test timeout of 5 secs (see the AssertionError above), and whenever a test exceeds this limit it considers the test to have failed.

This timeout is configurable though, so you may want to increase the value when running the tests in a VM. See STORM_TEST_TIMEOUT_MS at https://github.com/apache/storm/blob/master/DEVELOPER.md#build-the-code-and-run-the-tests.

Thanks, I set this to 20 seconds and it worked! I encountered another failure:

[info] Feature: AvroDecoderBolt[T]
[info]   Scenario: User creates a Storm topology that uses AvroDecoderBolt *** FAILED ***
[info]   SynchronizedQueue() was not equal to List({"username": "ANY_USER_1", "text": "ANY_TEXT_1", "timestamp": 1443029722}, {"username": "ANY_USER_2", "text": "ANY_TEXT_2", "timestamp": 0}, {"username": "ANY_USER_3", "text": "ANY_TEXT_3", "timestamp": 1234}) (KafkaStormSpec.scala:259)
[info]     Given a ZooKeeper instance 
[info]     And a Kafka broker instance 
[info]     And a Storm topology that uses AvroDecoderBolt and that reads tweets from topic testing-input} and writes them as-is to topic testing-output 
[info]     And some tweets 
[info]     And a synchronous Kafka producer app that writes to the topic testing-input 
[info]     And a single-threaded Kafka consumer app that reads from topic testing-output and Avro-decodes the incoming data 
[info]     And a Storm topology configuration that registers an Avro Kryo decorator for Tweet 
[info]     When I run the Storm topology 
[info]     And I Avro-encode the tweets and use the Kafka producer app to sent them to Kafka 
[info]     Synchronously sending Tweet {"username": "ANY_USER_1", "text": "ANY_TEXT_1", "timestamp": 1443029722} to topic Some(testing-input) 
[info]     Synchronously sending Tweet {"username": "ANY_USER_2", "text": "ANY_TEXT_2", "timestamp": 0} to topic Some(testing-input) 
[info]     Synchronously sending Tweet {"username": "ANY_USER_3", "text": "ANY_TEXT_3", "timestamp": 1234} to topic Some(testing-input) 
[info]     Then the Kafka consumer app should receive the original tweets from the Storm topology 

Hmm, I have seen this before I think (quite a while back). IIRC it was related to timing problems similar to the one you mentioned initially. Maybe STORM_TEST_TIMEOUT_MS alone is not sufficient. Is the error/test failure consistent across test runs? And can you try running the tests outside of a VM?

The failure was consistent across three runs. I will try running the tests outside of a VM at a later time.

This is in the scenario code and may help:

// Note: Should test messages arrive out-of-order, we may want to enforce a parallelism of 1 for this bolt.
builder.setBolt(decoderBoltId, decoderBolt).globalGrouping(kafkaSpoutId)

I am unable to test this. If someone else is having the issue, feel free to reopen.