Arquillian Cube Q Extension 1.0.0.Alpha1 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.Alpha1 release of the Arquillian Cube Q Extension component!

This is the first release of Arquillian Cube Q. Q is an extension of Arquillian Cube that allows you to write chaos tests. As in Cube, it relies on Docker to execute these kind of tests.

There are several level of chaos that you might introduce in order to verify how your services are behaving when unexpected happens. Starting from network chaos (latency, bandwidth limitation, …​) to operative system chaos (cpu burn, io burn, dill disk, …​). Arquillian Q as all the Arquillian projects, reuses existing chaos frameworks by integrating them into Arquillian universe.

Supported Chaos

Network Chaos

Arquillian Cube Q implements network chaos leveraging Toxiproxy project.

You can use following toxics:

A test with network chaos with Arquillian Cube Q looks like:

public class ToxicFuntionalTestCase {

  private NetworkChaos networkChaos;

  private String ip;

  public void shouldAddLatency() throws Exception {
    networkChaos.on("pingpong", 8080).latency(latencyInMillis(4000))
      .exec(() -> {

        URL url = new URL("http://" + ip + ":" + 8081 + "/hw/HelloWorld");
        final long l = System.currentTimeMillis();
        String response = IOUtil.asString(url.openStream());
        System.out.println("Time:" + (System.currentTimeMillis() - l));
        // assertions

In this example, the communication with pingpong container on exposed port 8080 is toxified with a latency of 4 seconds.

You can read more about network chaos at and an example at

Container Chaos

In order to introduce chaos to the container, Arquillian Q integrates with Pumba project.

It supports following toxics:

  • stopping a container
  • removing a container
  • killing a container process with a signal.

A test with container chaos with Arquillian Cube Q looks as simple as:

public class PumbaFunctionalTestCase {

  ContainerChaos containerChaos;

  DockerClient dockerClient;

  public void shouldKillContainers() throws Exception {

        final List<Container> containers = dockerClient.listContainersCmd().exec();
        // Pumba container is not killed by itself



In this example, containers called pingpong are killed every 4 seconds.

You can read more about container chaos at and an example at

Operative System Chaos

To do operative system chaos Arquillian Q uses some modified version of Netflix Simian Army project scripts.

At this moment we provide:

  • blocking a port
  • burning CPU or IO
  • filling the disk
  • killing the process
  • null route

Here’s the example of the test with operative system chaos using Arquillian Cube Q:

public class SimianArmyFunctionalTestCase {

    OperativeSystemChaos operativeSystemChaos;

    String dockerHost;

    @HostPort(containerName = "pingpong ", value = 8080)
    int port;

    @Test(expected = Exception.class)
    public void shouldExecuteBurnCpuChaos() throws Exception {

p.This test burns one of the CPU

You can read more about operative system chaos at and an example at

What’s Next

As it is an Alpha1 release, you might expect some changes in the API as we move towards the final version, although we will try hard to not break anything.

Currently the toxics are explicitly defined in the code, for example you statically define latency of 4 seconds. Next step is creating a random method using which you can randomize the parameters of the toxics. Similarly you would be able to randomize the order of applying toxics.

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Cube Q Extension
Version 1.0.0.Alpha1 view tag
Release date 2016-08-29
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.cube.q

  • org.arquillian.cube.q » arquillian-cube-q-api jar javadoc pom
  • org.arquillian.cube.q » arquillian-cube-q-spi jar javadoc pom
  • org.arquillian.cube.q » arquillian-cube-q-core jar javadoc pom
  • org.arquillian.cube.q » arquillian-cube-q-toxic jar javadoc pom
  • org.arquillian.cube.q » arquillian-cube-q-pumba jar javadoc pom
  • org.arquillian.cube.q » arquillian-cube-q-simianarmy jar javadoc pom

Thanks to the following list of contributors: Alex Soto, Aslak Knutsen, Stefan Miklosovic