Skip to content

Commit

Permalink
Add more comments on server concurrent test
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Jun 16, 2019
1 parent 21ab69f commit 4d18882
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/dmsg/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,11 @@ func TestServer_Serve(t *testing.T) {
// while remotes may handle from 0 to `initiatorsCount` connections
pickedRemotes := make([]int, 0, initiatorsCount)
for i := 0; i < initiatorsCount; i++ {
// pick random remote, which the initiator will connect to
remote := rand.Intn(remotesCount)
// increment the number of connections picked remote will handle
usedRemotes[remote] = usedRemotes[remote] + 1
// map initiator to picked remote
pickedRemotes = append(pickedRemotes, remote)
}

Expand Down

0 comments on commit 4d18882

Please sign in to comment.