[PSM Interop] Improve assertRpcStatusCodes before/after stats logging (#33360)
Do not clutter the final error we see at the end with the before/after stats. #### Examples ###### Expected only status A, but found status B for method M: ``` [ FAILED ] CustomLbTest.test_custom_lb_config ====================================================================== FAIL: test_custom_lb_config (__main__.CustomLbTest) CustomLbTest.test_custom_lb_config ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/sergiitk/Development/grpc/tools/run_tests/xds_k8s_test_driver/tests/custom_lb_test.py", line 113, in test_custom_lb_config self.assertRpcStatusCodes(test_client, File "/Users/sergiitk/Development/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py", line 345, in assertRpcStatusCodes found_status = helpers_grpc.status_from_int(found_status_int) AssertionError: Expected only status (15, DATA_LOSS), but found status (0, OK) for method UNARY_CALL. Diff stats: - method: UNARY_CALL rpcs_started: 251 result: (0, OK): 251 ``` ###### Expected non-zero RPCs with status A for method M. ``` [ FAILED ] AuthzTest.test_plaintext_allow ====================================================================== FAIL: test_plaintext_allow (__main__.AuthzTest) AuthzTest.test_plaintext_allow ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/sergiitk/Development/grpc/tools/run_tests/xds_k8s_test_driver/tests/authz_test.py", line 224, in test_plaintext_allow self.configure_and_assert(test_client, 'host-wildcard', File "/Users/sergiitk/Development/grpc/tools/run_tests/xds_k8s_test_driver/tests/authz_test.py", line 204, in configure_and_assert self.assertRpcStatusCodes(test_client, File "/Users/sergiitk/Development/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py", line 355, in assertRpcStatusCodes self.assertGreater(stats.result[expected_status_int], AssertionError: 0 not greater than 0 : Expected non-zero completed RPCs with status (0, OK) for method EMPTY_CALL. Diff stats: - method: EMPTY_CALL rpcs_started: 13 result: {} ```pull/33383/head
parent
6f685274a1
commit
a95e8c4ff4
1 changed files with 31 additions and 26 deletions
Loading…
Reference in new issue