Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok committed Sep 20, 2024
1 parent e09f6b0 commit 2f53df2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p2p/pkg/rpc/provider/export_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package providerapi

func (s *Service) ActiveReceivers() int {
return int(s.activeReceivers.Load())
}
11 changes: 11 additions & 0 deletions p2p/pkg/rpc/provider/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,17 @@ func TestBidHandling(t *testing.T) {
}
}()

activeReceiverTimeout := time.Now().Add(2 * time.Second)
for {
if svc.ActiveReceivers() > 0 {
break
}
if time.Now().After(activeReceiverTimeout) {
t.Fatalf("timed out waiting for active receivers")
}
time.Sleep(10 * time.Millisecond)
}

sndr, err := client.SendProcessedBids(context.Background())
if err != nil {
t.Fatalf("error sending processed bids: %v", err)
Expand Down

0 comments on commit 2f53df2

Please sign in to comment.