Skip to content

Commit

Permalink
remove raciness from test
Browse files Browse the repository at this point in the history
  • Loading branch information
ross-pure committed May 11, 2022
1 parent ecdbbb0 commit 532e566
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions aw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,18 +372,13 @@ var _ = Describe("Peer", func() {
peer2.ContentResolver.InsertContent(successID, []byte("content"))

for i := 0; i < int(opts.MaxPendingSyncs); i++ {
i := i
go func() {
contentID := []byte(fmt.Sprintf("%v", i))
syncCtx, syncCancel := context.WithTimeout(ctx, 100*time.Millisecond)
peer1.Sync(syncCtx, contentID, nil)
syncCancel()
}()
contentID := []byte(fmt.Sprintf("%v", i))
syncCtx, syncCancel := context.WithTimeout(ctx, 1*time.Millisecond)
peer1.Sync(syncCtx, contentID, nil)
syncCancel()
}

time.Sleep(100 * time.Millisecond)

syncCtx, syncCancel := context.WithTimeout(ctx, 100*time.Millisecond)
syncCtx, syncCancel := context.WithTimeout(ctx, 10*time.Millisecond)
_, err := peer1.Sync(syncCtx, successID, nil)
syncCancel()

Expand Down

0 comments on commit 532e566

Please sign in to comment.