From b3a3671c6a8dcc153e044c6b00a6054bd487620d Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Wed, 24 Jul 2024 14:54:36 +0200 Subject: [PATCH] fix: use static port number for prometheus test (#14000) --- enterprise/cli/provisionerdaemons_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/enterprise/cli/provisionerdaemons_test.go b/enterprise/cli/provisionerdaemons_test.go index 299ddd1d4f..b8e785ec45 100644 --- a/enterprise/cli/provisionerdaemons_test.go +++ b/enterprise/cli/provisionerdaemons_test.go @@ -301,11 +301,11 @@ func TestProvisionerDaemon_SessionToken(t *testing.T) { }) } -//nolint:paralleltest,tparallel // Prometheus endpoint tends to fail with `bind: address already in use`. +//nolint:paralleltest,tparallel // Test uses a static port. func TestProvisionerDaemon_PrometheusEnabled(t *testing.T) { - t.Skip("Flaky test - see https://github.com/coder/coder/issues/13931") - - prometheusPort := testutil.RandomPortNoListen(t) + // Ephemeral ports have a tendency to conflict and fail with `bind: address already in use` error. + // This workaround forces a static port for Prometheus that hopefully won't be used by other tests. + prometheusPort := 32001 // Configure CLI client client, admin := coderdenttest.New(t, &coderdenttest.Options{