mirror of
https://github.com/livekit/livekit.git
synced 2026-10-28 23:02:34 +00:00
test: fix TestEgressStore updating the wrong egress info (#5078)
The test mutates info2 (room "another-egress-test") to COMPLETE with an EndedAt 24h in the past, then persists `info` instead of `info2`. So info2 stays STARTING forever, CleanEndedEgress never removes it, and the record leaks into whatever Redis the suite ran against. The leak is invisible because the final assertion only lists the primary room. It surfaces on the NEXT run: utils_test.go:49 prefers a reachable localhost:6379 over an ephemeral dockertest container, so against a persistent Redis the list-all assertion grows by one record per run and TestEgressStore starts failing with "should have 2 item(s), but has 3". With info2 persisted, CleanEndedEgress removes both records and the test cleans up after itself. Verified: 3 consecutive runs green, zero keys left.
This commit is contained in:
1 parent
37901309a3
commit
6db4a7ab8c
1 file changed
+1
-1
@@ -209,7 +209,7 @@ func TestEgressStore(t *testing.T) {
|
||||
// update
|
||||
info2.Status = livekit.EgressStatus_EGRESS_COMPLETE
|
||||
info2.EndedAt = time.Now().Add(-24 * time.Hour).UnixNano()
|
||||
require.NoError(t, rs.UpdateEgress(ctx, info))
|
||||
require.NoError(t, rs.UpdateEgress(ctx, info2))
|
||||
|
||||
// list
|
||||
list, err := rs.ListEgress(ctx, "", false)
|
||||
|
||||
Reference in new issue
Block a user