From bba435b2ef04cdbe3246779699792e2a43ee73cf Mon Sep 17 00:00:00 2001 From: evgeniy-scherbina Date: Fri, 2 Aug 2024 15:28:55 -0400 Subject: [PATCH] Add debug info --- testing/retry_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testing/retry_test.go b/testing/retry_test.go index 7d3ebc2..384d580 100644 --- a/testing/retry_test.go +++ b/testing/retry_test.go @@ -22,6 +22,7 @@ import ( "fmt" "math/rand" "regexp" + "sync/atomic" "testing" "time" @@ -45,11 +46,14 @@ func TestBlockRetry(t *testing.T) { } errChan := make(chan serviceError, numJobs) + var globalReq atomic.Uint64 for i := 0; i < numJobs; i++ { go func() { time.Sleep(time.Duration(rand.Intn(1000)) * time.Millisecond) - for { + for req := 0; ; req++ { + globalReq.Add(1) + select { case <-jobCtx.Done(): return @@ -66,6 +70,8 @@ func TestBlockRetry(t *testing.T) { fmt.Printf("err : %v\n", err) fmt.Printf("rosettaErr : %v\n", rosettaErr) fmt.Printf("networkStatus: %v\n", networkStatus) + fmt.Printf("req : %v\n", req) + fmt.Printf("globalReq : %v\n", globalReq.Load()) currentBlock := networkStatus.CurrentBlockIdentifier request := &types.BlockRequest{