Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
lock peer table in test to pacify the race detector
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Mar 2, 2019
1 parent db5374f commit 4e3bea6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autonat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ func newDialResponseError(status pb.Message_ResponseStatus, text string) *pb.Mes
func makeAutoNAT(ctx context.Context, t *testing.T, ash host.Host) (host.Host, AutoNAT) {
h := bhost.NewBlankHost(swarmt.GenSwarm(t, ctx))
a := NewAutoNAT(ctx, h, nil)
a.(*AmbientAutoNAT).mx.Lock()
a.(*AmbientAutoNAT).peers[ash.ID()] = ash.Addrs()

a.(*AmbientAutoNAT).mx.Unlock()
return h, a
}

Expand Down

0 comments on commit 4e3bea6

Please sign in to comment.