agent: make Reap test timing less aggressive
This commit is contained in:
parent
f0f00a1401
commit
cfe3437c0c
|
@ -1515,7 +1515,7 @@ func TestAgent_Service_MaintenanceMode(t *testing.T) {
|
||||||
func TestAgent_Service_Reap(t *testing.T) {
|
func TestAgent_Service_Reap(t *testing.T) {
|
||||||
// t.Parallel() // timing test. no parallel
|
// t.Parallel() // timing test. no parallel
|
||||||
cfg := TestConfig()
|
cfg := TestConfig()
|
||||||
cfg.CheckReapInterval = time.Millisecond
|
cfg.CheckReapInterval = 50 * time.Millisecond
|
||||||
cfg.CheckDeregisterIntervalMin = 0
|
cfg.CheckDeregisterIntervalMin = 0
|
||||||
a := NewTestAgent(t.Name(), cfg)
|
a := NewTestAgent(t.Name(), cfg)
|
||||||
defer a.Shutdown()
|
defer a.Shutdown()
|
||||||
|
@ -1589,7 +1589,7 @@ func TestAgent_Service_Reap(t *testing.T) {
|
||||||
func TestAgent_Service_NoReap(t *testing.T) {
|
func TestAgent_Service_NoReap(t *testing.T) {
|
||||||
// t.Parallel() // timing test. no parallel
|
// t.Parallel() // timing test. no parallel
|
||||||
cfg := TestConfig()
|
cfg := TestConfig()
|
||||||
cfg.CheckReapInterval = time.Millisecond
|
cfg.CheckReapInterval = 50 * time.Millisecond
|
||||||
cfg.CheckDeregisterIntervalMin = 0
|
cfg.CheckDeregisterIntervalMin = 0
|
||||||
a := NewTestAgent(t.Name(), cfg)
|
a := NewTestAgent(t.Name(), cfg)
|
||||||
defer a.Shutdown()
|
defer a.Shutdown()
|
||||||
|
@ -1621,7 +1621,7 @@ func TestAgent_Service_NoReap(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the check TTL to fail.
|
// Wait for the check TTL to fail.
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(200 * time.Millisecond)
|
||||||
if _, ok := a.state.Services()["redis"]; !ok {
|
if _, ok := a.state.Services()["redis"]; !ok {
|
||||||
t.Fatalf("should have redis service")
|
t.Fatalf("should have redis service")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue