MCPcopy
hub / github.com/nats-io/nats.go / TestOldContextRequestWithTimeoutCanceled

Function TestOldContextRequestWithTimeoutCanceled

test/context_test.go:198–209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

196}
197
198func TestOldContextRequestWithTimeoutCanceled(t *testing.T) {
199 s := RunDefaultServer()
200 defer s.Shutdown()
201
202 nc, err := nats.Connect(nats.DefaultURL, nats.UseOldRequestStyle())
203 if err != nil {
204 t.Fatalf("Failed to connect: %v", err)
205 }
206 defer nc.Close()
207
208 testContextRequestWithTimeoutCanceled(t, nc)
209}
210
211func testContextRequestWithCancel(t *testing.T, nc *nats.Conn) {
212 ctx, cancelCB := context.WithCancel(context.Background())

Callers

nothing calls this directly

Calls 5

ConnectMethod · 0.80
FatalfMethod · 0.80
RunDefaultServerFunction · 0.70
CloseMethod · 0.45

Tested by

no test coverage detected