System Integration & Performance Testing

This directory contains Kafka system integration and performance tests. ducktape is used to run the tests.
(ducktape is a distributed testing framework which provides test runner, result reporter and utilities to pull up and tear down services.)

Running tests using docker

Docker containers can be used for running kafka system tests locally.

Local Quickstart

This quickstart will help you run the Kafka system tests on your local machine. Note this requires bringing up a cluster of virtual machines on your local computer, which is memory intensive; it currently requires around 10G RAM. For a tutorial on how to setup and run the Kafka system tests, see https://cwiki.apache.org/confluence/display/KAFKA/tutorial+-+set+up+and+run+Kafka+system+tests+with+ducktape

EC2 Quickstart

This quickstart will help you run the Kafka system tests on EC2. In this setup, all logic is run on EC2 and none on your local machine.

There are a lot of steps here, but the basic goals are to create one distinguished EC2 instance that will be our “test driver”, and to set up the security groups and iam role so that the test driver can create, destroy, and run ssh commands on any number of “workers”.

As a convention, we’ll use “kafkatest” in most names, but you can use whatever name you want.


In these steps, we will create an IAM role which has permission to create and destroy EC2 instances, set up a keypair used for ssh access to the test driver and worker machines, and create a security group to allow the test driver and workers to all communicate via TCP.

Create the Test Driver

Set Up the Test Driver

The following steps assume you have ssh’d into the test driver machine.

If you change code in a branch on your driver VM, you need to update your worker VM to pick up this change:

    $ ./gradlew systemTestLibs
    $ vagrant rsync

Unit Tests

The system tests have unit tests! The various services in the python kafkatest module are reasonably complex, and intended to be reusable. Hence we have unit tests for the system service classes.

Where are the unit tests?

How do I run the unit tests?

$ cd kafka/tests # The base system test directory
$ python3 setup.py test

How can I add a unit test?