Skip to content

Commit

Permalink
Merge branch 'main' into reece/contrib-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups authored Nov 9, 2023
2 parents 13b044d + 91b1e51 commit b36a66d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions signer/threshold_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,17 @@ func testThresholdValidatorLeaderElection(t *testing.T, threshold, total uint8)
require.NoError(t, err)
}

quit := make(chan bool)
done := make(chan bool)

go func() {
for i := 0; true; i++ {
select {
case <-quit:
done <- true
return
default:
}
// simulate leader election
for _, l := range leaders {
l.SetLeader(nil)
Expand Down Expand Up @@ -493,8 +502,12 @@ func testThresholdValidatorLeaderElection(t *testing.T, threshold, total uint8)
}

wg.Wait()

require.True(t, success) // at least one should succeed so that the block is not missed.
}

quit <- true
<-done
}

func TestThresholdValidatorLeaderElection2of3(t *testing.T) {
Expand Down

0 comments on commit b36a66d

Please sign in to comment.