mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-11 07:59:08 +02:00
[client, management] Recover from stuck proof collections and keep re-tracked accounts on the challenge refresher (#7890)
Co-authored-by: Viktor Liu <viktor@netbird.io>
This commit is contained in:
co-authored by
Viktor Liu
parent
f0a40e4395
commit
008cf47512
@@ -39,6 +39,17 @@ func TestCertPostureState_Record(t *testing.T) {
|
||||
assert.True(t, unproven.record("k", "", nil, now), "losing the proof again is reported")
|
||||
}
|
||||
|
||||
// TestCertPostureState_ReportsStuckOnce: a store that stopped answering is reported to
|
||||
// the user once when it wedges the collector, not on every collection that follows, and
|
||||
// again if it wedges anew after recovering.
|
||||
func TestCertPostureState_ReportsStuckOnce(t *testing.T) {
|
||||
var s certPostureState
|
||||
assert.True(t, s.setStuck(true), "becoming stuck is reported")
|
||||
assert.False(t, s.setStuck(true), "staying stuck is not reported again")
|
||||
assert.False(t, s.setStuck(false), "recovering is not a stuck report")
|
||||
assert.True(t, s.setStuck(true), "getting stuck again is reported again")
|
||||
}
|
||||
|
||||
func TestCertPostureState_NeedsCollection(t *testing.T) {
|
||||
now := time.Now()
|
||||
one := []certposture.Proof{{}}
|
||||
|
||||
Reference in New Issue
Block a user