Skip to content

Commit 2fe0f3b

Browse files
Fix events test
Signed-off-by: Alexandros Filios <alexandros.filios@ibm.com>
1 parent 8296e09 commit 2fe0f3b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

platform/fabric/events_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,18 @@ func TestEventListener(t *testing.T) {
6666
defer cancel()
6767
go func() {
6868
defer wg.Done()
69-
stop := false
7069
for {
7170
select {
7271
case event := <-eventChannel:
7372
assert.NotNil(t, event)
7473
case <-ctx.Done():
75-
stop = true
76-
}
77-
if stop {
7874
listener.CloseChaincodeEvents()
79-
break
75+
return
8076
}
8177
}
8278
}()
8379
wg.Wait()
80+
time.Sleep(100 * time.Millisecond)
8481

8582
// Ensure the channel is closed
8683
select {

0 commit comments

Comments
 (0)