|
|
@ -430,6 +430,14 @@ func TestHTTPAgentRegisterService(t *testing.T) {
|
|
|
|
Check: CheckType{
|
|
|
|
Check: CheckType{
|
|
|
|
TTL: 15 * time.Second,
|
|
|
|
TTL: 15 * time.Second,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
Checks: CheckTypes{
|
|
|
|
|
|
|
|
&CheckType{
|
|
|
|
|
|
|
|
TTL: 20 * time.Second,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
&CheckType{
|
|
|
|
|
|
|
|
TTL: 30 * time.Second,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
req.Body = encodeReq(args)
|
|
|
|
req.Body = encodeReq(args)
|
|
|
|
|
|
|
|
|
|
|
@ -447,12 +455,13 @@ func TestHTTPAgentRegisterService(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Ensure we have a check mapping
|
|
|
|
// Ensure we have a check mapping
|
|
|
|
if _, ok := srv.agent.state.Checks()["service:test"]; !ok {
|
|
|
|
checks := srv.agent.state.Checks()
|
|
|
|
t.Fatalf("missing test check")
|
|
|
|
if len(checks) != 3 {
|
|
|
|
|
|
|
|
t.Fatalf("bad: %v", checks)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if _, ok := srv.agent.checkTTLs["service:test"]; !ok {
|
|
|
|
if len(srv.agent.checkTTLs) != 3 {
|
|
|
|
t.Fatalf("missing test check ttl")
|
|
|
|
t.Fatalf("missing test check ttls: %v", srv.agent.checkTTLs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|