From f312ad0548c124d9b29d2427f22029e340fe1050 Mon Sep 17 00:00:00 2001 From: Michael Stella Date: Mon, 7 Dec 2020 18:00:49 -0500 Subject: [PATCH] This is why we now have tests, right? It's really nice to have tests to catch this stuff now. --- .../tests/test_server_interceptor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py index 5186cd303c..cb61043c15 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_server_interceptor.py @@ -385,7 +385,12 @@ def handler(request, context): # make sure this span errored, with the right status and detail self.assertEqual(span.status.status_code, StatusCode.ERROR) - self.assertEqual(span.status.description, failure_message) + self.assertEqual( + span.status.description, + "{}:{}".format( + grpc.StatusCode.FAILED_PRECONDITION, failure_message + ), + ) # Check attributes self.assert_span_has_attributes(