From 6db4a7ab8c6a66bc2033e45934917948fb0bf54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elliot=20Morales=20Sol=C3=A9?= <5107985+elliotmoso@users.noreply.github.com> Date: Tue, 27 Oct 2026 16:27:34 +0100 Subject: [PATCH] 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. --- pkg/service/redisstore_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/service/redisstore_test.go b/pkg/service/redisstore_test.go index 419694537..c6caf0aeb 100644 --- a/pkg/service/redisstore_test.go +++ b/pkg/service/redisstore_test.go @@ -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)