Skip to content

Commit

Permalink
update rtmp failure test
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Aug 8, 2024
1 parent 58a492d commit 8c99ad9
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,25 @@ func (r *Runner) testRtmpFailure(t *testing.T) {
require.Equal(t, r.RoomName, info.RoomName)
require.Equal(t, livekit.EgressStatus_EGRESS_STARTING, info.Status)

// check update
// check updates
time.Sleep(time.Second * 5)
info = r.getUpdate(t, info.EgressId)
if info.Status == livekit.EgressStatus_EGRESS_ACTIVE {
info = r.getUpdate(t, info.EgressId)
}
if info.Status == livekit.EgressStatus_EGRESS_ACTIVE {
require.Equal(t, livekit.StreamInfo_FAILED, info.StreamResults[0].Status)
streamFailed := false
for info.Status == livekit.EgressStatus_EGRESS_ACTIVE {
if !streamFailed && info.StreamResults[0].Status == livekit.StreamInfo_FAILED {
streamFailed = true
}
if streamFailed {
// make sure this never reverts in subsequent updates
require.Equal(t, livekit.StreamInfo_FAILED, info.StreamResults[0].Status)
}
info = r.getUpdate(t, info.EgressId)
}
require.Equal(t, livekit.StreamInfo_FAILED, info.StreamResults[0].Status)

require.Equal(t, livekit.EgressStatus_EGRESS_FAILED, info.Status)
require.NotEmpty(t, info.Error)
require.Equal(t, livekit.StreamInfo_FAILED, info.StreamResults[0].Status)
require.NotEmpty(t, info.StreamResults[0].Error)
})
}

Expand Down

0 comments on commit 8c99ad9

Please sign in to comment.