MCPcopy Index your code
hub / github.com/DoNewsCode/core / TestClient_race

Function TestClient_race

clihttp/client_test.go:79–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestClient_race(t *testing.T) {
80 // the mock tracer is not concurrent safe.
81 // tracer := opentracing.GlobalTracer()
82 tracer := opentracing.NoopTracer{}
83 client := NewClient(tracer)
84 for i := 0; i < 100; i++ {
85 t.Run("", func(t *testing.T) {
86 t.Parallel()
87 r, _ := http.NewRequest("GET", "https://example.com/", nil)
88 resp, _ := client.Do(r)
89 defer resp.Body.Close()
90 })
91 }
92}
93
94func TestClient_context(t *testing.T) {
95 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

DoMethod · 0.95
NewClientFunction · 0.85
CloseMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected