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

Function TestCloserStack_PushAfterClose_ConnClosed

cli/ssh_internal_test.go:231–244  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

229}
230
231func TestCloserStack_PushAfterClose_ConnClosed(t *testing.T) {
232 t.Parallel()
233 ctx := testutil.Context(t, testutil.WaitShort)
234 logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}).Leveled(slog.LevelDebug)
235 uut := newCloserStack(ctx, logger, quartz.NewMock(t))
236
237 uut.close(xerrors.New("canceled"))
238
239 closes := new([]*fakeCloser)
240 fc := &fakeCloser{closes: closes}
241 err := uut.push("conn", fc)
242 require.Error(t, err)
243 require.Equal(t, []*fakeCloser{fc}, *closes, "should close conn on failed push")
244}
245
246func TestCoderConnectDialer_DefaultTimeout(t *testing.T) {
247 t.Parallel()

Callers

nothing calls this directly

Calls 7

ContextFunction · 0.92
newCloserStackFunction · 0.85
pushMethod · 0.80
closeMethod · 0.65
NewMethod · 0.65
ErrorMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected