From ed23b7f9744aee6fff0e441a392aec8976064e8e Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 28 May 2024 08:55:07 -0700 Subject: [PATCH] Wait a bit after shutdown to let goroutines terminate. --- sippy/stm_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sippy/stm_test.go b/sippy/stm_test.go index a111237..0feb2b2 100644 --- a/sippy/stm_test.go +++ b/sippy/stm_test.go @@ -3,6 +3,7 @@ package sippy import ( "testing" "runtime" + "time" "github.com/sippy/go-b2bua/sippy/conf" "github.com/sippy/go-b2bua/sippy/log" @@ -26,6 +27,7 @@ func Test_SipTransactionManager(t *testing.T) { } go cmap.sip_tm.Run() cmap.sip_tm.Shutdown() + time.Sleep(100 * time.Millisecond) numGoroutinesAfter := runtime.NumGoroutine() if numGoroutinesBefore != numGoroutinesAfter { t.Fatalf("numGoroutinesBefore = %d, numGoroutinesAfter = %d\n", numGoroutinesBefore, numGoroutinesAfter)