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

Function pollORCAResult

interop/orcalb_test.go:350–363  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, tc testgrpc.TestServiceClient, want *v3orcapb.OrcaLoadReport)

Source from the content-addressed store, hash-verified

348}
349
350func pollORCAResult(ctx context.Context, t *testing.T, tc testgrpc.TestServiceClient, want *v3orcapb.OrcaLoadReport) {
351 t.Helper()
352 for ; ctx.Err() == nil; <-time.After(time.Second) {
353 orcaRes := &v3orcapb.OrcaLoadReport{}
354 if _, err := tc.UnaryCall(contextWithORCAResult(ctx, &orcaRes), &testpb.SimpleRequest{}); err != nil {
355 t.Fatalf("UnaryCall failed: %v", err)
356 }
357 if diff := cmp.Diff(orcaRes, want, protocmp.Transform()); diff == "" {
358 return
359 }
360 t.Logf("ORCA load report = %v; want %v; retrying...", orcaRes, want)
361 }
362 t.Fatalf("Timed out waiting for expected ORCA load report %v", want)
363}

Callers 1

TestORCAOOBFallbackMethod · 0.85

Calls 5

contextWithORCAResultFunction · 0.85
ErrMethod · 0.80
UnaryCallMethod · 0.65
FatalfMethod · 0.65
LogfMethod · 0.65

Tested by

no test coverage detected