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

Function TestOldContextRequestWithTimeout

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

Source from the content-addressed store, hash-verified

125}
126
127func TestOldContextRequestWithTimeout(t *testing.T) {
128 s := RunDefaultServer()
129 defer s.Shutdown()
130
131 nc, err := nats.Connect(nats.DefaultURL, nats.UseOldRequestStyle())
132 if err != nil {
133 t.Fatalf("Failed to connect: %v", err)
134 }
135 defer nc.Close()
136
137 testContextRequestWithTimeout(t, nc)
138}
139
140func testContextRequestWithTimeoutCanceled(t *testing.T, nc *nats.Conn) {
141 ctx, cancelCB := context.WithTimeout(context.Background(), 100*time.Millisecond)

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