From 0a1c4e717d4b2b0ae9e75936cbf8c77ae1999cd0 Mon Sep 17 00:00:00 2001 From: Angelo Capossele <angelocapossele@gmail.com> Date: Tue, 21 Jul 2020 15:12:38 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Speed-up=20dRNG=20integrat?= =?UTF-8?q?ion=20test=20(#660)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/integration-tests/tester/framework/docker.go | 5 ++++- tools/integration-tests/tester/framework/drngnetwork.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/integration-tests/tester/framework/docker.go b/tools/integration-tests/tester/framework/docker.go index 5fd40921..3bc9b7cb 100644 --- a/tools/integration-tests/tester/framework/docker.go +++ b/tools/integration-tests/tester/framework/docker.go @@ -213,8 +213,11 @@ func (d *DockerContainer) Remove() error { // Stop stops a container without terminating the process. // The process is blocked until the container stops or the timeout expires. -func (d *DockerContainer) Stop() error { +func (d *DockerContainer) Stop(optionalTimeout ...time.Duration) error { duration := 3 * time.Minute + if optionalTimeout != nil { + duration = optionalTimeout[0] + } return d.client.ContainerStop(context.Background(), d.id, &duration) } diff --git a/tools/integration-tests/tester/framework/drngnetwork.go b/tools/integration-tests/tester/framework/drngnetwork.go index 2f3031ce..ee055784 100644 --- a/tools/integration-tests/tester/framework/drngnetwork.go +++ b/tools/integration-tests/tester/framework/drngnetwork.go @@ -93,7 +93,7 @@ func (n *DRNGNetwork) CreateMember(leader bool) (*Drand, error) { func (n *DRNGNetwork) Shutdown() error { // stop drand members for _, p := range n.members { - err := p.Stop() + err := p.Stop(5 * time.Second) if err != nil { return err } -- GitLab