mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
skip reloader in failing test
Signed-off-by: Lovro Mažgon <lovro.mazgon@gmail.com>
This commit is contained in:
parent
d60f34a324
commit
582753daa8
|
@ -87,8 +87,9 @@ type Options struct {
|
||||||
// Optional HTTP client options to use when scraping.
|
// Optional HTTP client options to use when scraping.
|
||||||
HTTPClientOptions []config_util.HTTPClientOption
|
HTTPClientOptions []config_util.HTTPClientOption
|
||||||
|
|
||||||
// private option for testability.
|
// private options for testability.
|
||||||
skipOffsetting bool
|
skipOffsetting bool
|
||||||
|
skipReloader bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manager maintains a set of scrape pools and manages start/stop cycles
|
// Manager maintains a set of scrape pools and manages start/stop cycles
|
||||||
|
@ -114,7 +115,9 @@ type Manager struct {
|
||||||
// Run receives and saves target set updates and triggers the scraping loops reloading.
|
// Run receives and saves target set updates and triggers the scraping loops reloading.
|
||||||
// Reloading happens in the background so that it doesn't block receiving targets updates.
|
// Reloading happens in the background so that it doesn't block receiving targets updates.
|
||||||
func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group) error {
|
func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group) error {
|
||||||
go m.reloader()
|
if !m.opts.skipReloader {
|
||||||
|
go m.reloader()
|
||||||
|
}
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case ts := <-tsets:
|
case ts := <-tsets:
|
||||||
|
|
|
@ -572,7 +572,7 @@ scrape_configs:
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestManagerTargetsUpdates(t *testing.T) {
|
func TestManagerTargetsUpdates(t *testing.T) {
|
||||||
opts := Options{}
|
opts := Options{skipReloader: true}
|
||||||
testRegistry := prometheus.NewRegistry()
|
testRegistry := prometheus.NewRegistry()
|
||||||
m, err := NewManager(&opts, nil, nil, testRegistry)
|
m, err := NewManager(&opts, nil, nil, testRegistry)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
Loading…
Reference in a new issue