Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/storage/sessions_retention_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestEnforceSessionRetention_KeepsLiveSessionWhenClosedOnesCouldGo(t *testin
"a connected client's record must not be evicted while closed records remain")
assert.Equal(t, "active", got.Status)

sessions, total, err := m.GetRecentSessions(sessionRetentionLimit)
sessions, total, err := m.GetRecentSessions(sessionRetentionLimit, "")
require.NoError(t, err)
assert.LessOrEqual(t, total, sessionRetentionLimit, "the hard cap must still hold")
assert.True(t, containsSessionID(sessions, "live-session"),
Expand Down Expand Up @@ -249,7 +249,7 @@ func TestEnforceSessionRetention_KeepsIdleLiveSessionOverFresherClosedOnes(t *te
"however recently those closed sessions were active")
assert.Equal(t, "active", got.Status)

sessions, total, err := m.GetRecentSessions(sessionRetentionLimit)
sessions, total, err := m.GetRecentSessions(sessionRetentionLimit, "")
require.NoError(t, err)
assert.Equal(t, sessionRetentionLimit, total)
assert.True(t, containsSessionID(sessions, "idle-live-session"),
Expand All @@ -275,7 +275,7 @@ func TestEnforceSessionRetention_CapHoldsWhenEverySessionIsActive(t *testing.T)
require.NoError(t, m.CreateSession(s))
}

sessions, total, err := m.GetRecentSessions(sessionRetentionLimit + 100)
sessions, total, err := m.GetRecentSessions(sessionRetentionLimit+100, "")
require.NoError(t, err)
assert.Equal(t, sessionRetentionLimit, total,
"an all-active bucket must still be capped — otherwise abandoned sessions grow without bound")
Expand All @@ -297,7 +297,7 @@ func TestEnforceSessionRetention_EvictsOldestClosedFirst(t *testing.T) {
require.NoError(t, m.CreateSession(s))
}

sessions, total, err := m.GetRecentSessions(sessionRetentionLimit + 50)
sessions, total, err := m.GetRecentSessions(sessionRetentionLimit+50, "")
require.NoError(t, err)
assert.Equal(t, sessionRetentionLimit, total)

Expand Down
Loading