A suite of tests of kafka in failing network. Based on https://github.com/wurstmeister/kafka-docker. Please refer to the original README.md for information on how to build and configure the image.
- install docker-compose https://docs.docker.com/compose/install/
- install docker-py https://github.com/docker/docker-py/
- modify
ZK_COMMAND
inkafka-network-tests.py
to match your zookeeper image - if you want to customize any Kafka parameters, simply add them as environment variables in
docker-compose.yml
, e.g. in order to increase themessage.max.bytes
parameter set the environment to
- run all tests:
py.test -s kafka-network-tests.py
- run individual tests:
py.test -s kafka-network-tests.py -k test_producing_to_lost_leader_using_java_producer_and_ifdown
- run individual tests:
py.test -s kafka-network-tests.py -k test_producing_to_lost_leader_using_librdkafka_producer_and_ifdown
The test with the java producer and ifdown shows that there's a 9-23 seconds long gap where no values were stored in the log after the network was taken down.
The test with the librdkafka producer and ifdown shows that no values was stored in the log after the network was taken down at.