mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 10:35:51 +00:00
Fix discovery test Prometheus metric collision
Remove t.Parallel() from tests that verify global Prometheus gauge values. When tests run in parallel, they update the same global gauges (discoveryScanServers, discoveryScanErrors) causing race conditions and incorrect metric values. Fixes test failure in workflow run 19281332332: - TestPerformScanRecordsHistoryAndMetrics expected 2 servers, got 1 Related to release workflow preflight tests.
This commit is contained in:
@@ -35,8 +35,6 @@ func (f *fakeScanner) DiscoverServersWithCallbacks(ctx context.Context, subnet s
|
||||
}
|
||||
|
||||
func TestPerformScanRecordsHistoryAndMetrics(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
service := NewService(nil, time.Minute, "192.168.1.0/24", func() config.DiscoveryConfig {
|
||||
cfg := config.DefaultDiscoveryConfig()
|
||||
cfg.SubnetBlocklist = []string{"10.0.0.0/24", "172.16.0.0/24"}
|
||||
@@ -103,8 +101,6 @@ func TestPerformScanRecordsHistoryAndMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPerformScanRecordsPartialFailure(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
service := NewService(nil, time.Minute, "auto", func() config.DiscoveryConfig {
|
||||
cfg := config.DefaultDiscoveryConfig()
|
||||
return cfg
|
||||
|
||||
Reference in New Issue
Block a user