[SERVER-81216] ASSERT_OK on a StatusWith<T> assertion failed logging is unreadable Created: 19/Sep/23  Updated: 29/Oct/23  Resolved: 22/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Patrick Freed Assignee: Patrick Freed
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2023-10-02
Participants:
Linked BF Score: 11

 Description   

ASSERT_OK properly asserts whether a StatusWith<T> is OK or not, but when an assertion fails it will log an unreadable message.

e.g.

Expected ::mongo::Status::OK() == (m) (OK  == [mongo::StatusWith<mongo::Message>=a0 22 42 2a 78 7f 00 00 00 a5 03 37 78 7f 00 00 00 01 62 10 fe 7f 00 00]) @src/mongo/transport/grpc/grpc_transport_layer_test.cpp:242

We should update this to log the message an ASSERT_OK on a non-OK Status would.

e.g.

Expected ::mongo::Status::OK() == (m.getStatus()) (OK  == CallbackCanceled foo) @src/mongo/transport/grpc/grpc_transport_layer_test.cpp:242



 Comments   
Comment by Githook User [ 22/Sep/23 ]

Author:

{'name': 'Patrick Freed', 'email': 'patrick.freed@mongodb.com', 'username': 'patrickfreed'}

Message: SERVER-81216 Properly stringify StatusWith<T> in test assertions
Branch: master
https://github.com/mongodb/mongo/commit/bb7ec9b51e5ef3b1eab991bdb4a006cc90cdcb7c

Generated at Thu Feb 08 06:45:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.