mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
test: use static port for Prometheus (#14972)
Fixes: https://github.com/coder/internal/issues/92
This commit is contained in:
@ -59,10 +59,11 @@ func Test_ProxyServer_Headers(t *testing.T) {
|
||||
assert.EqualValues(t, 1, atomic.LoadInt64(&called))
|
||||
}
|
||||
|
||||
//nolint:paralleltest,tparallel // Test uses a static port.
|
||||
func TestWorkspaceProxy_Server_PrometheusEnabled(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
prometheusPort := testutil.RandomPort(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 := 32002
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
|
Reference in New Issue
Block a user