Log actual recorded events on panic in `match_events!` (#4069)
## Motivation and Context We've had flaky tests in our release pipeline. The pain points are that reproducing these failures is difficult and that when a test does fail, `panic` from the `match_events!` macro does not provide visibility into the actual recorded events. This PR does not address the underlying test failures but aims to improve visibility into the actual recorded events when a test fails. This will help us better diagnose and troubleshoot flaky tests. Here is the new diagnostic message looks like (deliberately made a test fail just to show what the message looks like): ``` expected `ev!(connect)` but got Response(HttpResponse { status: 429, body: b"{\"__type\":\"com.amazonaws.dynamodb.v20120810#ThrottlingException\",\n\"message\":\"enhance your calm\"}" }) actual recorded events: [DnsLookup("this-url-is-converted-to-localhost.com"), NewConnection, Response(HttpResponse { status: 429, body: b"{\"__type\":\"com.amazonaws.dynamodb.v20120810#ThrottlingException\",\n\"message\":\"enhance your calm\"}" }), Response(HttpResponse { status: 200, body: b"{\"Count\":0,\"Items\":[],\"ScannedCount\":2}" })] ``` ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Loading
Please register or sign in to comment