open-consul/agent/grpc
Daniel Nephin 1e40f00567 agent/grpc: make TestHandler_EmitsStats predictable
Occasionally this test would flake. The flakes were fixed by:

1. Stopping the service and retrying to check on metrics. This way we
   also include the active_streams going to 0 in the metric calls.

2. Using a reference to the global Metrics. This way when other tests
   have background goroutines that are still shutting down, they won't
   emit metrics to the metric instance with the fake Sink. The stats
   test can patch the local reference to the global, so the existing
   statHandlers will continue to emit to the global, but the stats
   test will send all metrics to the replacement.
2020-09-14 19:05:22 -04:00
..
internal/testservice grpc: add Datacenter field to testing service response 2020-09-14 19:02:09 -04:00
handler.go agent/grpc: make TestHandler_EmitsStats predictable 2020-09-14 19:05:22 -04:00
server_test.go agent/grpc: make TestHandler_EmitsStats predictable 2020-09-14 19:05:22 -04:00
stats.go agent/grpc: make TestHandler_EmitsStats predictable 2020-09-14 19:05:22 -04:00
stats_test.go agent/grpc: make TestHandler_EmitsStats predictable 2020-09-14 19:05:22 -04:00