added service reannounce

This commit is contained in:
Stephan D
2026-03-01 14:46:42 +01:00
parent ce23de94ce
commit e5ba048c73

View File

@@ -94,6 +94,7 @@ func TestAnnouncerPeriodicReannounce(t *testing.T) {
waitForAtLeast(t, 1*time.Second, func() int { return producer.count(announceEvent) }, 1, "initial announce") waitForAtLeast(t, 1*time.Second, func() int { return producer.count(announceEvent) }, 1, "initial announce")
waitForAtLeast(t, 1*time.Second, func() int { return producer.count(heartbeatEvent) }, 1, "initial heartbeat") waitForAtLeast(t, 1*time.Second, func() int { return producer.count(heartbeatEvent) }, 1, "initial heartbeat")
// With 1s heartbeat and factor=3, periodic re-announce should happen in ~3s. // With 1s heartbeat and factor=N, periodic re-announce should happen in ~N seconds.
waitForAtLeast(t, 5*time.Second, func() int { return producer.count(announceEvent) }, 2, "periodic re-announce") timeout := time.Duration(defaultReannounceHeartbeatFactor+2) * time.Second
waitForAtLeast(t, timeout, func() int { return producer.count(announceEvent) }, 2, "periodic re-announce")
} }