added service reannounce
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user