diff --git a/test/edge.go b/test/edge.go index 8ad96bc5..38f171b4 100644 --- a/test/edge.go +++ b/test/edge.go @@ -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) }) }