Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
115687: stmtdiagnostics: skip TestDiagnosticsRequest under deadlock r=erikgrinaker a=arulajmani

This test takes a really long time to run (~30s) normally. The introduction of test-only pushed this test over the edge when run under the deadlock detector -- it started reporting spurious deadlocks. This patch skips it under deadlock, and while here, also skips it under short.

Closes cockroachdb#115620

Release note: None

115688: scbuild: skip TestBuildIsMemoryMonitored under deadlock r=erikgrinaker a=arulajmani

TestBuildIsMemoryMonitored takes a long time to run as it creates thousands of tables. The introduction of test-only verification of the lock table pushed it over the edge when run under the deadlock detector -- we'd occasionally get reports about spurious deadlocks. This patch skips the test under deadlock.

Closes cockroachdb#115542
Release note: None

Co-authored-by: Arul Ajmani <[email protected]>
  • Loading branch information
craig[bot] and arulajmani committed Dec 6, 2023
3 parents 8180142 + f23c9f5 + c1bf099 commit 7b54813
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/sql/schemachanger/scbuild/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ go_test(
"//pkg/sql/sessiondatapb",
"//pkg/testutils/datapathutils",
"//pkg/testutils/serverutils",
"//pkg/testutils/skip",
"//pkg/testutils/sqlutils",
"//pkg/util/leaktest",
"//pkg/util/log",
Expand Down
4 changes: 3 additions & 1 deletion pkg/sql/schemachanger/scbuild/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb"
"github.com/cockroachdb/cockroach/pkg/testutils/datapathutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
Expand Down Expand Up @@ -291,6 +292,8 @@ func TestBuildIsMemoryMonitored(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

skip.UnderDeadlock(t, "takes too long")

ctx := context.Background()
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
Knobs: base.TestingKnobs{
Expand Down Expand Up @@ -325,5 +328,4 @@ func TestBuildIsMemoryMonitored(t *testing.T) {
_, err = scbuild.Build(ctx, dependencies, scpb.CurrentState{}, stmt.AST, &memAcc)
require.ErrorContainsf(t, err, `test-sc-build-mon: memory budget exceeded:`, "got a memory usage of: %d", memAcc.Allocated())
})

}
1 change: 1 addition & 0 deletions pkg/sql/stmtdiagnostics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ go_test(
"//pkg/sql/sqlerrors",
"//pkg/testutils",
"//pkg/testutils/serverutils",
"//pkg/testutils/skip",
"//pkg/testutils/sqlutils",
"//pkg/testutils/testcluster",
"//pkg/util/leaktest",
Expand Down
4 changes: 4 additions & 0 deletions pkg/sql/stmtdiagnostics/statement_diagnostics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/stmtdiagnostics"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
Expand All @@ -44,6 +45,9 @@ func TestDiagnosticsRequest(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

skip.UnderShort(t)
skip.UnderDeadlock(t, "the test is too slow")

srv, db, _ := serverutils.StartServer(t, base.TestServerArgs{})
ctx := context.Background()
defer srv.Stopper().Stop(ctx)
Expand Down

0 comments on commit 7b54813

Please sign in to comment.