Skip to content

Commit

Permalink
Sometimes there isn't enough time to wait for an event. Increased the…
Browse files Browse the repository at this point in the history
… time.

Fixed working with break operator

Signed-off-by: Fedor Partanskiy <[email protected]>
  • Loading branch information
pfi79 committed Nov 26, 2023
1 parent 31f018a commit 887e0d9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ func TestViewChangeAfterTryingToFork(t *testing.T) {
nodes[4].Connect()

// Waiting for a real change of leader and view
fail = time.After(1 * time.Minute)
fail = time.After(90 * time.Second)
for i := 0; i < 7; i++ {
select {
case <-realViewChangeCh:
Expand All @@ -2675,12 +2675,14 @@ func TestViewChangeAfterTryingToFork(t *testing.T) {
data := make([]*AppRecord, 0, 7)
storeI := -1
fail = time.After(1 * time.Minute)
ExternalLoop:
for i := 0; i < numberOfNodes; i++ {
select {
case d := <-nodes[i].Delivered:
data = append(data, d)
case <-fail:
storeI = i
break ExternalLoop
}
}

Expand Down Expand Up @@ -2961,7 +2963,7 @@ func TestLeaderStopSendHeartbeat(t *testing.T) {
nodes[2].Connect()
nodes[3].Connect()

fail = time.After(1 * time.Minute)
fail = time.After(90 * time.Second)
for i := 0; i < 4; i++ {
select {
case <-realViewChangeCh:
Expand Down Expand Up @@ -3228,7 +3230,7 @@ func TestTryCommittedSequenceTwice(t *testing.T) {
nodes[4].Connect()

// Waiting for a real change of leader and view
fail = time.After(1 * time.Minute)
fail = time.After(90 * time.Second)
for i := 0; i < 7; i++ {
select {
case <-realViewChangeCh:
Expand All @@ -3240,12 +3242,14 @@ func TestTryCommittedSequenceTwice(t *testing.T) {
data := make([]*AppRecord, 0, 7)
storeI := -1
fail = time.After(1 * time.Minute)
ExternalLoop:
for i := 0; i < numberOfNodes; i++ {
select {
case d := <-nodes[i].Delivered:
data = append(data, d)
case <-fail:
storeI = i
break ExternalLoop
}
}

Expand Down

0 comments on commit 887e0d9

Please sign in to comment.