Skip to content

Commit 9acf6ac

Browse files
authored
test: use static port for Prometheus (coder#14972)
Fixes: coder/internal#92
1 parent 4369f2b commit 9acf6ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

enterprise/cli/proxyserver_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ func Test_ProxyServer_Headers(t *testing.T) {
5959
assert.EqualValues(t, 1, atomic.LoadInt64(&called))
6060
}
6161

62+
//nolint:paralleltest,tparallel // Test uses a static port.
6263
func TestWorkspaceProxy_Server_PrometheusEnabled(t *testing.T) {
63-
t.Parallel()
64-
65-
prometheusPort := testutil.RandomPort(t)
64+
// Ephemeral ports have a tendency to conflict and fail with `bind: address already in use` error.
65+
// This workaround forces a static port for Prometheus that hopefully won't be used by other tests.
66+
prometheusPort := 32002
6667

6768
var wg sync.WaitGroup
6869
wg.Add(1)

0 commit comments

Comments
 (0)