MCPcopy
hub / github.com/containerd/containerd / TestClientTTRPC_Reconnect

Function TestClientTTRPC_Reconnect

integration/client/client_ttrpc_test.go:45–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestClientTTRPC_Reconnect(t *testing.T) {
46 if testing.Short() {
47 t.Skip()
48 }
49 client, err := ttrpcutil.NewClient(address + ".ttrpc")
50 assert.NoError(t, err)
51
52 err = client.Reconnect()
53 assert.NoError(t, err)
54
55 service, err := client.EventsService()
56 assert.NoError(t, err)
57
58 // Send test request to make sure its alive after reconnect
59 _, err = service.Forward(context.Background(), &v1.ForwardRequest{
60 Envelope: &apitypes.Envelope{
61 Timestamp: protobuf.ToTimestamp(time.Now()),
62 Namespace: namespaces.Default,
63 Topic: "/test",
64 Event: &types.Any{},
65 },
66 })
67 assert.NoError(t, err)
68
69 err = client.Close()
70 assert.NoError(t, err)
71}
72
73func TestClientTTRPC_Close(t *testing.T) {
74 if testing.Short() {

Callers

nothing calls this directly

Calls 6

ReconnectMethod · 0.95
EventsServiceMethod · 0.95
CloseMethod · 0.95
NewClientFunction · 0.92
ToTimestampFunction · 0.92
ForwardMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…