added service reannounce #595

Merged
tech merged 1 commits from discovery-593 into main 2026-03-01 13:47:11 +00:00

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(heartbeatEvent) }, 1, "initial heartbeat")
// With 1s heartbeat and factor=3, periodic re-announce should happen in ~3s.
waitForAtLeast(t, 5*time.Second, func() int { return producer.count(announceEvent) }, 2, "periodic re-announce")
// With 1s heartbeat and factor=N, periodic re-announce should happen in ~N seconds.
timeout := time.Duration(defaultReannounceHeartbeatFactor+2) * time.Second
waitForAtLeast(t, timeout, func() int { return producer.count(announceEvent) }, 2, "periodic re-announce")
}