MCPcopy Index your code
hub / github.com/coder/coder / TestWatcher_ClosedBeforeDial

Function TestWatcher_ClosedBeforeDial

coderd/workspaceconnwatcher/watcher_test.go:416–427  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

414}
415
416func TestWatcher_ClosedBeforeDial(t *testing.T) {
417 t.Parallel()
418
419 ctx := testutil.Context(t, testutil.WaitShort)
420 logger := testutil.Logger(t)
421 h := newHarness(ctx, t, logger)
422 h.watcher.Close()
423 _, err := h.Dial(ctx, "wss://local.test/")
424 var sdkError *codersdk.Error
425 require.True(t, errors.As(err, &sdkError))
426 require.Equal(t, http.StatusServiceUnavailable, sdkError.StatusCode())
427}
428
429func TestWatcher_ClosedAfterDial(t *testing.T) {
430 t.Parallel()

Callers

nothing calls this directly

Calls 8

StatusCodeMethod · 0.95
ContextFunction · 0.92
LoggerFunction · 0.92
newHarnessFunction · 0.85
AsMethod · 0.80
CloseMethod · 0.65
DialMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected