Skip to content

Commit

Permalink
[FAB-11187] Extend event client test timing window
Browse files Browse the repository at this point in the history
This change extends the time window for watching for expected events
to 10s (was previously 5s).

Change-Id: I0f4ad0e2361b8dd8be283ed7fdd6a184a52c04e9
Signed-off-by: Troy Ronda <[email protected]>
  • Loading branch information
troyronda committed Jul 17, 2018
1 parent 4f98d62 commit 868c695
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/integration/pkg/fab/eventclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"github.com/hyperledger/fabric-sdk-go/test/integration"
)

const eventTimeWindow = 10 * time.Second // the amount of time to watch for events, in order to compare to expectations.

func TestEventClient(t *testing.T) {
chainCodeID := mainChaincodeID
sdk := mainSDK
Expand Down Expand Up @@ -170,7 +172,7 @@ func checkTxStatusEvent(wg *sync.WaitGroup, txstatusch <-chan *fab.TxStatusEvent
test.Failf(t, "Expecting non-zero block number")
}
atomic.AddUint32(numReceived, 1)
case <-time.After(5 * time.Second):
case <-time.After(eventTimeWindow):
return
}
}
Expand Down Expand Up @@ -201,7 +203,7 @@ func checkCCEvent(wg *sync.WaitGroup, cceventch <-chan *fab.CCEvent, t *testing.
test.Failf(t, "Expecting non-zero block number")
}
atomic.AddUint32(numReceived, 1)
case <-time.After(5 * time.Second):
case <-time.After(eventTimeWindow):
return
}
}
Expand All @@ -224,7 +226,7 @@ func checkFilteredBlockEvent(wg *sync.WaitGroup, fbeventch <-chan *fab.FilteredB
continue
}
atomic.AddUint32(numReceived, 1)
case <-time.After(5 * time.Second):
case <-time.After(eventTimeWindow):
return
}
}
Expand All @@ -242,7 +244,7 @@ func checkBlockEvent(wg *sync.WaitGroup, beventch <-chan *fab.BlockEvent, t *tes
test.Failf(t, "Expecting block in block event but got nil")
}
atomic.AddUint32(numReceived, 1)
case <-time.After(5 * time.Second):
case <-time.After(eventTimeWindow):
}
}

Expand Down

0 comments on commit 868c695

Please sign in to comment.