mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 06:17:27 -08:00
config: add test case for scrape interval larger than timeout. (#6037)
Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
parent
31a8ac3219
commit
8d3083e256
|
@ -664,6 +664,15 @@ func TestLoadConfig(t *testing.T) {
|
||||||
testutil.Equals(t, expectedConf, c)
|
testutil.Equals(t, expectedConf, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestScrapeIntervalLarger(t *testing.T) {
|
||||||
|
c, err := LoadFile("testdata/scrape_interval_larger.good.yml")
|
||||||
|
testutil.Ok(t, err)
|
||||||
|
testutil.Equals(t, 1, len(c.ScrapeConfigs))
|
||||||
|
for _, sc := range c.ScrapeConfigs {
|
||||||
|
testutil.Equals(t, true, sc.ScrapeInterval >= sc.ScrapeTimeout)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// YAML marshaling must not reveal authentication credentials.
|
// YAML marshaling must not reveal authentication credentials.
|
||||||
func TestElideSecrets(t *testing.T) {
|
func TestElideSecrets(t *testing.T) {
|
||||||
c, err := LoadFile("testdata/conf.good.yml")
|
c, err := LoadFile("testdata/conf.good.yml")
|
||||||
|
|
16
config/testdata/scrape_interval_larger.good.yml
vendored
Normal file
16
config/testdata/scrape_interval_larger.good.yml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
scrape_timeout: 15s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: prometheus
|
||||||
|
|
||||||
|
scrape_interval: 5s
|
||||||
|
|
||||||
|
dns_sd_configs:
|
||||||
|
- refresh_interval: 15s
|
||||||
|
names:
|
||||||
|
- first.dns.address.domain.com
|
||||||
|
- second.dns.address.domain.com
|
||||||
|
- names:
|
||||||
|
- first.dns.address.domain.com
|
Loading…
Reference in a new issue