MCPcopy
hub / github.com/dapr/dapr / TestPingSimulateFailure

Method TestPingSimulateFailure

pkg/api/grpc/proxy/handler_test.go:394–406  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

392}
393
394func (s *proxyTestSuite) TestPingSimulateFailure() {
395 ctx, cancel := s.ctx()
396 defer cancel()
397
398 s.service.simulatePingFailures.Store(1)
399 defer func() {
400 s.service.simulatePingFailures.Store(0)
401 }()
402
403 _, err := s.testClient.Ping(ctx, &pb.PingRequest{Value: "Ciao mamma guarda come mi diverto"})
404 s.Require().Error(err, "Ping should return a simulated failure")
405 s.Require().ErrorContains(err, "Simulated failure")
406}
407
408func (s *proxyTestSuite) setupResiliency() {
409 timeout := 500 * time.Millisecond

Callers

nothing calls this directly

Calls 4

ctxMethod · 0.95
PingMethod · 0.65
StoreMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected