Skip to content

Commit

Permalink
Merge pull request #1308 from lightninglabs/itest-flake-log
Browse files Browse the repository at this point in the history
Add Logging to Diagnose Flaky CI PostgreSQL Integration Test
  • Loading branch information
ffranr authored Jan 17, 2025
2 parents 99f313f + 218bc29 commit d8b9974
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion itest/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,8 @@ func AssertSendEvents(t *testing.T, scriptKey []byte,
go func() {
select {
case <-timeout:
t.Logf("AssertSendEvents: cancelling stream after " +
"timeout")
stream.Cancel()

case <-success:
Expand All @@ -1020,8 +1022,14 @@ func AssertSendEvents(t *testing.T, scriptKey []byte,
require.NoError(t, err, "receiving send event")

require.True(t, sendsToKey(event))

// Check the event's error field for unexpected errors. Perform
// this check before verifying the expected send state, as
// errors might occur alongside an out-of-order send state.
require.Emptyf(
t, event.Error, "send event error: %x", event,
)
require.Equal(t, startStatus.String(), event.SendState)
require.Empty(t, event.Error)

// Fully close the stream once we definitely no longer need the
// stream.
Expand Down

0 comments on commit d8b9974

Please sign in to comment.