Skip to content

Commit ba4715a

Browse files
committed
asim: add leaktest, log.Scope defer stmt for TestDataDriven
Previously, TestDataDriven didn’t have standard defer statements like leaktest.AfterTest and log.Scope(t).Close(t), leading to some missing post test clean up logic. This commit fixes that. Epic: none Release note: none
1 parent 27ae7cc commit ba4715a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/kv/kvserver/asim/tests/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ go_test(
5151
"//pkg/testutils/datapathutils",
5252
"//pkg/testutils/skip",
5353
"//pkg/util/envutil",
54+
"//pkg/util/leaktest",
55+
"//pkg/util/log",
5456
"@com_github_cockroachdb_datadriven//:datadriven",
5557
"@com_github_guptarohit_asciigraph//:asciigraph",
5658
"@com_github_stretchr_testify//require",

pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import (
2626
"github.com/cockroachdb/cockroach/pkg/testutils/datapathutils"
2727
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
2828
"github.com/cockroachdb/cockroach/pkg/util/envutil"
29+
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
30+
"github.com/cockroachdb/cockroach/pkg/util/log"
2931
"github.com/cockroachdb/datadriven"
3032
"github.com/guptarohit/asciigraph"
3133
"github.com/stretchr/testify/require"
@@ -171,6 +173,8 @@ var runAsimTests = envutil.EnvOrDefaultBool("COCKROACH_RUN_ASIM_TESTS", false)
171173
// ..US_3
172174
// ....└── [11 12 13 14 15]
173175
func TestDataDriven(t *testing.T) {
176+
defer leaktest.AfterTest(t)()
177+
defer log.Scope(t).Close(t)
174178
skip.UnderDuressWithIssue(t, 149875)
175179
ctx := context.Background()
176180
dir := datapathutils.TestDataPath(t, "non_rand")

0 commit comments

Comments
 (0)