ExpediaGroup / adaptive-alerting

Anomaly detection for streaming time series, featuring automated model selection.
Apache License 2.0
203 stars 49 forks source link

Create kafka-junit test for KafkaAnomalyDetectorManager #369

Open williewheeler opened 5 years ago

williewheeler commented 5 years ago

Currently the unit test is based on Kafka's test-utils package, but kafka-junit provides deeper support as it allows us to set up a mock broker with input/output topics that we can use. Update the existing unit test to use kafka-junit.

williewheeler commented 5 years ago

Not so sure we want to do this after all. On a couple occasions I've run into seeming interactions between tests where disabling one kafka-junit test causes another one to fail:

Connection to node 1 could not be established. Broker may not be available.

This could easily be a matter of my inexperience with kafka-junit.

Might make more sense to use the Kafka Streams test framework, which doesn't spin up a broker, and save the broker stuff for integration tests.

https://kafka.apache.org/11/documentation/streams/developer-guide/testing.html

@adriancole Do you have an opinion here?