Skip to content

Commit

Permalink
Add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Aug 2, 2024
1 parent b9456d0 commit bba435b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion testing/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"math/rand"
"regexp"
"sync/atomic"
"testing"
"time"

Expand All @@ -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
Expand All @@ -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{
Expand Down

0 comments on commit bba435b

Please sign in to comment.