Skip to content

Commit

Permalink
Merge "[FAB-5503] Fix TestLeaderYield CI failure"
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rWin authored and Gerrit Code Review committed Aug 2, 2017
2 parents bc9b85b + d96fe6f commit 31b9705
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gossip/service/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func TestLeaderYield(t *testing.T) {

// Returns index of the leader or -1 if no leader elected
getLeader := func() int {
p0.lock.RLock()
p1.lock.RLock()
defer p0.lock.RUnlock()
defer p1.lock.RUnlock()

if p0.leaderElection[channelName].IsLeader() {
// Ensure p1 isn't a leader at the same time
assert.False(t, p1.leaderElection[channelName].IsLeader())
Expand Down

0 comments on commit 31b9705

Please sign in to comment.