Skip to content

Commit

Permalink
Wait a bit after shutdown to let goroutines terminate.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed May 28, 2024
1 parent b738651 commit ed23b7f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sippy/stm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sippy
import (
"testing"
"runtime"
"time"

"github.com/sippy/go-b2bua/sippy/conf"
"github.com/sippy/go-b2bua/sippy/log"
Expand All @@ -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)
Expand Down

0 comments on commit ed23b7f

Please sign in to comment.