From bbe11d1e7f96bcda230ba2aa05fb7bbbd997e643 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 11 Nov 2025 23:34:49 +0000 Subject: [PATCH] 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. --- internal/discovery/service_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/discovery/service_test.go b/internal/discovery/service_test.go index 4601fa632..f3251f65d 100644 --- a/internal/discovery/service_test.go +++ b/internal/discovery/service_test.go @@ -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