From 93c562097a167af13e6578d82762d0f18f78eeac Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 1 Dec 2021 13:57:56 -0800 Subject: [PATCH] Kill all Tor Connections at end of Integ Test --- testing/cwtch_peer_server_integration_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testing/cwtch_peer_server_integration_test.go b/testing/cwtch_peer_server_integration_test.go index 43a708b..86e50ec 100644 --- a/testing/cwtch_peer_server_integration_test.go +++ b/testing/cwtch_peer_server_integration_test.go @@ -333,13 +333,16 @@ func TestCwtchPeerIntegration(t *testing.T) { time.Sleep(2 * time.Second) t.Logf("Done shutdown: %v\n", runtime.NumGoroutine()) - numGoRoutinesPostAppShutdown := runtime.NumGoroutine() t.Logf("Shutting down ACN...") + acn.Restart() // kill all active tor connections... // acn.Close() TODO: ACN Now gets closed automatically with defer...attempting to close twice results in a dead lock... - time.Sleep(time.Second * 2) // Server ^^ has a 5 second loop attempting reconnect before exiting time.Sleep(time.Second * 30) // the network status plugin might keep goroutines alive for a minute before killing them + + numGoRoutinesPostAppShutdown := runtime.NumGoroutine() + + // Printing out the current goroutines // Very useful if we are leaking any. pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)