Skip to content

Commit

Permalink
skip reloader in failing test
Browse files Browse the repository at this point in the history
Signed-off-by: Lovro Mažgon <lovro.mazgon@gmail.com>
  • Loading branch information
lovromazgon committed May 9, 2024
1 parent d60f34a commit 582753d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions scrape/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ type Options struct {
// Optional HTTP client options to use when scraping.
HTTPClientOptions []config_util.HTTPClientOption

// private option for testability.
// private options for testability.
skipOffsetting bool
skipReloader bool
}

// Manager maintains a set of scrape pools and manages start/stop cycles
Expand All @@ -114,7 +115,9 @@ type Manager struct {
// 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.
func (m *Manager) Run(tsets <-chan map[string][]*targetgroup.Group) error {
go m.reloader()
if !m.opts.skipReloader {
go m.reloader()
}
for {
select {
case ts := <-tsets:
Expand Down
2 changes: 1 addition & 1 deletion scrape/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ scrape_configs:
}

func TestManagerTargetsUpdates(t *testing.T) {
opts := Options{}
opts := Options{skipReloader: true}
testRegistry := prometheus.NewRegistry()
m, err := NewManager(&opts, nil, nil, testRegistry)
require.NoError(t, err)
Expand Down

0 comments on commit 582753d

Please sign in to comment.