Skip to content

Commit

Permalink
Fix events test
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Filios <[email protected]>
  • Loading branch information
alexandrosfilios committed Jan 21, 2025
1 parent eb9938a commit e8b8446
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions platform/fabric/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,18 @@ func TestEventListener(t *testing.T) {
defer cancel()
go func() {
defer wg.Done()
stop := false
for {
select {
case event := <-eventChannel:
assert.NotNil(t, event)
case <-ctx.Done():
stop = true
}
if stop {
listener.CloseChaincodeEvents()
break
return
}
}
}()
wg.Wait()
time.Sleep(100 * time.Millisecond)

// Ensure the channel is closed
select {
Expand Down

0 comments on commit e8b8446

Please sign in to comment.