From 0137973191f3b6df2c2ec2306507d41930cc67bb Mon Sep 17 00:00:00 2001 From: wenyihu6 Date: Mon, 25 Sep 2023 22:17:14 +0800 Subject: [PATCH] asim: remove new line in PrintSpanConfigConformanceList Previously, PrintSpanConfigConformanceList included an extra line at the end. Following the asim output convention, most output functions defer the decision to include this extra line to caller (top level) rather than the callee functions. This patch removes the extra line in PrintSpanConfigConformanceList. Epic: None Release Note: None --- pkg/kv/kvserver/asim/assertion/assert.go | 5 ++++- pkg/kv/kvserver/asim/tests/output.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/kv/kvserver/asim/assertion/assert.go b/pkg/kv/kvserver/asim/assertion/assert.go index 71327e218cc0..6f5166e83257 100644 --- a/pkg/kv/kvserver/asim/assertion/assert.go +++ b/pkg/kv/kvserver/asim/assertion/assert.go @@ -405,8 +405,11 @@ func PrintSpanConfigConformanceList(tag string, ranges []roachpb.ConformanceRepo if i == 0 { buf.WriteString(fmt.Sprintf("%s:\n", tag)) } - buf.WriteString(fmt.Sprintf(" %s applying %s\n", printRangeDesc(r.RangeDescriptor), + buf.WriteString(fmt.Sprintf(" %s applying %s", printRangeDesc(r.RangeDescriptor), spanconfigtestutils.PrintSpanConfigDiffedAgainstDefaults(r.Config))) + if i != len(ranges)-1 { + buf.WriteString("\n") + } } return buf.String() } diff --git a/pkg/kv/kvserver/asim/tests/output.go b/pkg/kv/kvserver/asim/tests/output.go index 84814bcdf81e..0e5aae7cd29a 100644 --- a/pkg/kv/kvserver/asim/tests/output.go +++ b/pkg/kv/kvserver/asim/tests/output.go @@ -169,7 +169,7 @@ func (tr testResultsReport) String() string { buf.WriteString(output.eventExecutor.PrintEventsExecuted()) } if failed { - buf.WriteString(fmt.Sprintf("sample%d: failed assertion\n%s", nthSample, output.reason)) + buf.WriteString(fmt.Sprintf("sample%d: failed assertion\n%s\n", nthSample, output.reason)) } else { buf.WriteString(fmt.Sprintf("sample%d: pass\n", nthSample)) }