Skip to content

Commit

Permalink
sql/tests: include error with full stack trace in RSG tests
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
rafiss committed Nov 7, 2024
1 parent cff86d2 commit 1be1eb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/sql/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ go_test(
"//pkg/sql/catalog/tabledesc",
"//pkg/sql/parser",
"//pkg/sql/pgwire/pgcode",
"//pkg/sql/pgwire/pgerror",
"//pkg/sql/randgen",
"//pkg/sql/sem/builtins",
"//pkg/sql/sem/builtins/builtinsregistry",
Expand Down
8 changes: 5 additions & 3 deletions pkg/sql/tests/rsg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/parser"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror"
"github.com/cockroachdb/cockroach/pkg/sql/sem/builtins"
"github.com/cockroachdb/cockroach/pkg/sql/sem/builtins/builtinsregistry"
"github.com/cockroachdb/cockroach/pkg/sql/sem/eval"
Expand Down Expand Up @@ -228,8 +229,9 @@ func (db *verifyFormatDB) execWithResettableTimeout(
strings.Contains(es, "driver: bad connection") ||
strings.Contains(es, "unexpected error inside CockroachDB") {
return &crasher{
sql: sql,
err: err,
sql: sql,
err: err,
detail: pgerror.FullError(err),
}
}
return &nonCrasher{sql: sql, err: err}
Expand Down Expand Up @@ -959,7 +961,7 @@ func testRandomSyntax(
// NOTE: Changes to this output format must be kept in-sync
// with logic in CondensedMessage.RSGCrash in order for
// crashes to be correctly reported to Github.
t.Errorf("Crash detected: %s\n%s;\n\nStack trace:\n%s", c.Error(), c.sql, c.detail)
t.Errorf("Crash detected: %s\n%s;\n\nMore details:\n%s", c.Error(), c.sql, c.detail)
}
}
countsMu.Unlock()
Expand Down

0 comments on commit 1be1eb9

Please sign in to comment.