arquillian / arquillian-cube

Control (docker, kubernetes, openshift) containers in your tests with ease!
http://arquillian.org/arquillian-cube/
117 stars 98 forks source link

connectionMode STARTORCONNECTANDLEAVE tries to tear down network #1268

Open julianrschmidt opened 7 months ago

julianrschmidt commented 7 months ago
Issue Overview

In the Cube extension, when the connectionMode is set to STARTORCONNECTANDLEAVE and a Docker network is created during the start of the test, an attempt is made to delete this network at the end of the test. However, this deletion fails because the containers themselves are not deleted, as expected.

Expected Behaviour

The network should not be attempted to be deleted when the connectionMode is set to STARTORCONNECTANDLEAVE, even if it has been created by the test itself.

Current Behaviour

An attempt is made to delete the network, resulting in an exception at the end of the test:

Status 403: error while removing network: network arquillian id xxx has active endpoints

When the network exists before the test is started, the network won't be deleted, and everything works as expected.

Steps To Reproduce
  1. Use the cube extension with connectionMode set to STARTORCONNECTANDLEAVE.
  2. Use the docker extension with a docker compose file specifying a (currently non-exisiting) network.
  3. Run a test.