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/controller/ntnslice_satread_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func TestReconcile_UnknownSatellite_ResetsStreakKeepsDwell(t *testing.T) {
key := client.ObjectKeyFromObject(nsObj)
// Seed a confirmation + recovery streak AND a dwell clock from an earlier reliable window.
dwell := fixedNow.Add(-30 * time.Second)
r.storeFlapState(key, nsObj.UID, slice.AntiFlapState{
r.storeFlapState(key, nsObj.UID, nsObj.Generation, slice.AntiFlapState{
RecoveryObservedAt: fixedNow.Add(-200 * time.Second),
ConsecutiveDegraded: 2,
LastSwitchback: dwell,
Expand All @@ -192,7 +192,7 @@ func TestReconcile_UnknownSatellite_ResetsStreakKeepsDwell(t *testing.T) {
t.Fatalf("reconcile: %v", err)
}

st := r.loadFlapState(key, nsObj.UID)
st := r.loadFlapState(key, nsObj.UID, nsObj.Generation)
if !st.RecoveryObservedAt.IsZero() {
t.Errorf("recovery clock must reset when satellite availability is unknown (H2), got %v", st.RecoveryObservedAt)
}
Expand Down Expand Up @@ -265,7 +265,7 @@ func TestReconcile_MetricsUnreliableSatelliteKnown_ResetsStreakKeepsDwell(t *tes

key := client.ObjectKeyFromObject(nsObj)
dwell := fixedNow.Add(-30 * time.Second)
r.storeFlapState(key, nsObj.UID, slice.AntiFlapState{
r.storeFlapState(key, nsObj.UID, nsObj.Generation, slice.AntiFlapState{
RecoveryObservedAt: fixedNow.Add(-200 * time.Second),
ConsecutiveDegraded: 2,
LastSwitchback: dwell,
Expand All @@ -275,7 +275,7 @@ func TestReconcile_MetricsUnreliableSatelliteKnown_ResetsStreakKeepsDwell(t *tes
t.Fatalf("reconcile: %v", err)
}

st := r.loadFlapState(key, nsObj.UID)
st := r.loadFlapState(key, nsObj.UID, nsObj.Generation)
if !st.RecoveryObservedAt.IsZero() {
t.Errorf("recovery clock must reset on unreliable metrics with a known satellite (H2), got %v", st.RecoveryObservedAt)
}
Expand Down