mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 06:47:28 -08:00
Merge pull request #7739 from prometheus/release-2.20
Merge release-2.20 into the main branch after Consul fix
This commit is contained in:
commit
9da53391d1
|
@ -36,7 +36,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
watchTimeout = 10 * time.Minute
|
watchTimeout = 2 * time.Minute
|
||||||
retryInterval = 15 * time.Second
|
retryInterval = 15 * time.Second
|
||||||
|
|
||||||
// addressLabel is the name for the label containing a target's address.
|
// addressLabel is the name for the label containing a target's address.
|
||||||
|
@ -184,7 +184,7 @@ func NewDiscovery(conf *SDConfig, logger log.Logger) (*Discovery, error) {
|
||||||
}
|
}
|
||||||
wrapper := &http.Client{
|
wrapper := &http.Client{
|
||||||
Transport: transport,
|
Transport: transport,
|
||||||
Timeout: 35 * time.Second,
|
Timeout: time.Duration(watchTimeout) + 15*time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
clientConf := &consul.Config{
|
clientConf := &consul.Config{
|
||||||
|
|
|
@ -228,20 +228,20 @@ func newServer(t *testing.T) (*httptest.Server, *SDConfig) {
|
||||||
switch r.URL.String() {
|
switch r.URL.String() {
|
||||||
case "/v1/agent/self":
|
case "/v1/agent/self":
|
||||||
response = AgentAnswer
|
response = AgentAnswer
|
||||||
case "/v1/health/service/test?node-meta=rack_name%3A2304&stale=&tag=tag1&wait=600000ms":
|
case "/v1/health/service/test?node-meta=rack_name%3A2304&stale=&tag=tag1&wait=120000ms":
|
||||||
response = ServiceTestAnswer
|
response = ServiceTestAnswer
|
||||||
case "/v1/health/service/test?wait=600000ms":
|
case "/v1/health/service/test?wait=120000ms":
|
||||||
response = ServiceTestAnswer
|
response = ServiceTestAnswer
|
||||||
case "/v1/health/service/other?wait=600000ms":
|
case "/v1/health/service/other?wait=120000ms":
|
||||||
response = `[]`
|
response = `[]`
|
||||||
case "/v1/catalog/services?node-meta=rack_name%3A2304&stale=&wait=600000ms":
|
case "/v1/catalog/services?node-meta=rack_name%3A2304&stale=&wait=120000ms":
|
||||||
response = ServicesTestAnswer
|
response = ServicesTestAnswer
|
||||||
case "/v1/catalog/services?wait=600000ms":
|
case "/v1/catalog/services?wait=120000ms":
|
||||||
response = ServicesTestAnswer
|
response = ServicesTestAnswer
|
||||||
case "/v1/catalog/services?index=1&node-meta=rack_name%3A2304&stale=&wait=600000ms":
|
case "/v1/catalog/services?index=1&node-meta=rack_name%3A2304&stale=&wait=120000ms":
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
response = ServicesTestAnswer
|
response = ServicesTestAnswer
|
||||||
case "/v1/catalog/services?index=1&wait=600000ms":
|
case "/v1/catalog/services?index=1&wait=120000ms":
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
response = ServicesTestAnswer
|
response = ServicesTestAnswer
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue