added service reannounce #595
@@ -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")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user