From 97f639055e820dd2f9a7775e1570ff60b3ef9c03 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 4 Jul 2019 12:47:33 -0700 Subject: [PATCH] test: ensure double-closing the host doesn't cause any issues --- p2p/host/basic/basic_host_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index b80c702c9..5d582d5e1 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -23,6 +23,13 @@ import ( madns "github.com/multiformats/go-multiaddr-dns" ) +func TestHostDoubleClose(t *testing.T) { + ctx := context.Background() + h1 := New(swarmt.GenSwarm(t, ctx)) + h1.Close() + h1.Close() +} + func TestHostSimple(t *testing.T) { ctx := context.Background() h1 := New(swarmt.GenSwarm(t, ctx))