Systests - custom test with test-bulk-schema.sh fails to setup docker

Moved from GitHub dgraph/5716

Posted by darkn3rd:

What version of Dgraph are you using?

master

Have you tried reproducing the issue with the latest release?

yes

What is the hardware spec (RAM, OS)?

  • n1-standard-8 (8 vCPUs, 30 GB memory)
  • 100 GB SSD
  • Ubuntu Bionic Beaver

Steps to reproduce the issue (command/config used to run Dgraph).

./test.sh -F

The test harness fails when running:

  • ./dgraph/cmd/bulk/systest/test-bulk-schema.sh

Expected behaviour and actual result.

I expected that the tests execute, and not fail when setting up dgraph environment w/ docker.

INFO: Running custom test scripts
test-bulk-schema.sh: rebuilding dgraph
test-bulk-schema.sh: running bulk load schema test
test-bulk-schema.sh: using workdir /tmp/test.sh.tmp-G7DR45/test-bulk-schema.sh.tmp-BMmQoy
test-bulk-schema.sh: restarting cluster with only one zero and alpha
Stopping zero1  ... 
Stopping alpha1 ... 
Stopping zero1  ... done
Stopping alpha1 ... done
Found orphan containers (alpha6, alpha5, zero3, alpha4, zero2, alpha3, alpha2, minio1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Removing zero1  ... 
Removing alpha1 ... 
Removing zero1  ... done
Removing alpha1 ... done
Removing network dgraph_default
error while removing network: network dgraph_default id 60845b47a47933d9a020f3ed9449f61d90ff687b8fb18ae54bdd502810e88cba has active endpoints
test-bulk-schema.sh: *** unexpected error ***

This does not happen a 100%. It looks like the script had problems in orchestrating docker under certain conditions.

danielmai commented :

We should set the flag --remove-orphans when tearing down the cluster. That way, there aren’t existing containers that are part of the network that’s trying to be deleted.