MCPcopy
hub / github.com/grpc/grpc-go / TestDistributorEmpty

Method TestDistributorEmpty

credentials/tls/certprovider/distributor_test.go:32–42  ·  view source on GitHub ↗

TestDistributorEmpty tries to read key material from an empty distributor and expects the call to timeout.

(t *testing.T)

Source from the content-addressed store, hash-verified

30// TestDistributorEmpty tries to read key material from an empty distributor and
31// expects the call to timeout.
32func (s) TestDistributorEmpty(t *testing.T) {
33 dist := NewDistributor()
34
35 // This call to KeyMaterial() should timeout because no key material has
36 // been set on the distributor as yet.
37 ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
38 defer cancel()
39 if err := readAndVerifyKeyMaterial(ctx, dist, nil); !errors.Is(err, context.DeadlineExceeded) {
40 t.Fatal(err)
41 }
42}
43
44// TestDistributor invokes the different methods on the Distributor type and
45// verifies the results.

Callers

nothing calls this directly

Calls 4

NewDistributorFunction · 0.85
readAndVerifyKeyMaterialFunction · 0.85
IsMethod · 0.80
FatalMethod · 0.65

Tested by

no test coverage detected