From eb693885f67b70d73709c071dbed989e80c6e6a8 Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Mon, 22 Feb 2021 12:33:49 +0100 Subject: [PATCH] logictest: render contention key in contention_event It's nice that it works, but the final query is a monster! I'm glad there are [plans] to improve the UX. [plans]: https://github.com/cockroachdb/cockroach/pull/60784#issuecomment-783277766 Release note: None --- pkg/sql/logictest/testdata/logic_test/contention_event | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/sql/logictest/testdata/logic_test/contention_event b/pkg/sql/logictest/testdata/logic_test/contention_event index cc51e18fbfd4..94fc5dc3c202 100644 --- a/pkg/sql/logictest/testdata/logic_test/contention_event +++ b/pkg/sql/logictest/testdata/logic_test/contention_event @@ -49,7 +49,7 @@ user root # # NB: this needs the 5node-pretend59315 config because otherwise the span is not # tracked. -query B +query T WITH spans AS ( SELECT span_id FROM crdb_internal.node_inflight_trace_spans @@ -57,8 +57,12 @@ WITH spans AS ( ), payloads AS ( SELECT * FROM spans, LATERAL crdb_internal.payloads_for_span(spans.span_id) -) SELECT count(*) > 0 +) SELECT + -- Strip the first prefix because we don't want to have this test + -- become sensitive to changes in descriptor ID allocation. + crdb_internal.pretty_key(decode(payload_jsonb->>'key', 'base64'), 1) FROM payloads WHERE payload_type = 'roachpb.ContentionEvent' + LIMIT 1 ---- -true +/1/"k"/0