Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit 868c695

Browse files
committed
[FAB-11187] Extend event client test timing window
This change extends the time window for watching for expected events to 10s (was previously 5s). Change-Id: I0f4ad0e2361b8dd8be283ed7fdd6a184a52c04e9 Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent 4f98d62 commit 868c695

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/integration/pkg/fab/eventclient_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import (
2626
"github.com/hyperledger/fabric-sdk-go/test/integration"
2727
)
2828

29+
const eventTimeWindow = 10 * time.Second // the amount of time to watch for events, in order to compare to expectations.
30+
2931
func TestEventClient(t *testing.T) {
3032
chainCodeID := mainChaincodeID
3133
sdk := mainSDK
@@ -170,7 +172,7 @@ func checkTxStatusEvent(wg *sync.WaitGroup, txstatusch <-chan *fab.TxStatusEvent
170172
test.Failf(t, "Expecting non-zero block number")
171173
}
172174
atomic.AddUint32(numReceived, 1)
173-
case <-time.After(5 * time.Second):
175+
case <-time.After(eventTimeWindow):
174176
return
175177
}
176178
}
@@ -201,7 +203,7 @@ func checkCCEvent(wg *sync.WaitGroup, cceventch <-chan *fab.CCEvent, t *testing.
201203
test.Failf(t, "Expecting non-zero block number")
202204
}
203205
atomic.AddUint32(numReceived, 1)
204-
case <-time.After(5 * time.Second):
206+
case <-time.After(eventTimeWindow):
205207
return
206208
}
207209
}
@@ -224,7 +226,7 @@ func checkFilteredBlockEvent(wg *sync.WaitGroup, fbeventch <-chan *fab.FilteredB
224226
continue
225227
}
226228
atomic.AddUint32(numReceived, 1)
227-
case <-time.After(5 * time.Second):
229+
case <-time.After(eventTimeWindow):
228230
return
229231
}
230232
}
@@ -242,7 +244,7 @@ func checkBlockEvent(wg *sync.WaitGroup, beventch <-chan *fab.BlockEvent, t *tes
242244
test.Failf(t, "Expecting block in block event but got nil")
243245
}
244246
atomic.AddUint32(numReceived, 1)
245-
case <-time.After(5 * time.Second):
247+
case <-time.After(eventTimeWindow):
246248
}
247249
}
248250

0 commit comments

Comments
 (0)