Skip to content

Commit

Permalink
Backport of Dump response body on fail into release/1.16.x (#18964)
Browse files Browse the repository at this point in the history
backport of commit 5dbfce6

Co-authored-by: Chris S. Kim <[email protected]>
  • Loading branch information
hc-github-team-consul-core and Chris S. Kim authored Sep 21, 2023
1 parent 2dc2fb5 commit 100fbed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions agent/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@ func TestHTTPHandlers_AgentMetrics_WAL_Prometheus(t *testing.T) {
recordPromMetrics(t, a, respRec)

out := respRec.Body.String()
defer func() {
if t.Failed() {
t.Log("--- Failed output START ---")
t.Log(out)
t.Log("--- Failed output END ---")
}
}()
require.Contains(t, out, "agent_5_raft_wal_head_truncations")
require.Contains(t, out, "agent_5_raft_wal_last_segment_age_seconds")
require.Contains(t, out, "agent_5_raft_wal_log_appends")
Expand Down Expand Up @@ -588,6 +595,13 @@ func TestHTTPHandlers_AgentMetrics_LogVerifier_Prometheus(t *testing.T) {
recordPromMetrics(t, a, respRec)

out := respRec.Body.String()
defer func() {
if t.Failed() {
t.Log("--- Failed output START ---")
t.Log(out)
t.Log("--- Failed output END ---")
}
}()
require.Contains(t, out, "agent_5_raft_logstore_verifier_checkpoints_written")
require.Contains(t, out, "agent_5_raft_logstore_verifier_dropped_reports")
require.Contains(t, out, "agent_5_raft_logstore_verifier_ranges_verified")
Expand Down

0 comments on commit 100fbed

Please sign in to comment.