Skip to content

Commit

Permalink
roachtest: fix costfuzz and unoptimized-query-oracle setups
Browse files Browse the repository at this point in the history
This commit fixes a bug that was recently introduced when registering
the costfuzz and unoptimized-query-oracle tests. This bug was due to
the well-known range loop variable issue described here:
golang/go#20733.

This commit also adds some additional logging and debug information to
help with future issues with these test cases.

Fixes #90010

Release note: None
  • Loading branch information
rytaft committed Oct 19, 2022
1 parent 145d62f commit f353458
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/cmd/roachtest/tests/costfuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

func registerCostFuzz(r registry.Registry) {
for _, setupName := range []string{sqlsmith.RandTableSetupName, sqlsmith.SeedMultiRegionSetupName} {
setupName := setupName
var clusterSpec spec.ClusterSpec
switch setupName {
case sqlsmith.SeedMultiRegionSetupName:
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/roachtest/tests/query_comparison_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func runOneRoundQueryComparison(

rnd, seed := randutil.NewTestRand()
t.L().Printf("seed: %d", seed)
t.L().Printf("setupName: %s", qct.setupName)

setup := sqlsmith.Setups[qct.setupName](rnd)

Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/roachtest/tests/unoptimized_query_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func registerUnoptimizedQueryOracle(r registry.Registry) {
for i := range disableRuleSpecs {
disableRuleSpec := &disableRuleSpecs[i]
for _, setupName := range []string{sqlsmith.RandTableSetupName, sqlsmith.SeedMultiRegionSetupName} {
setupName := setupName
var clusterSpec spec.ClusterSpec
switch setupName {
case sqlsmith.SeedMultiRegionSetupName:
Expand Down
2 changes: 1 addition & 1 deletion pkg/internal/sqlsmith/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ FROM
key := tree.MakeSchemaQualifiedTypeName(scName, name)
udtMapping[key] = typ
default:
return nil, errors.New("unsupported SQLSmith type kind")
return nil, errors.Newf("unsupported SQLSmith type kind: %s", string(membersRaw))
}
}
var udts []*types.T
Expand Down

0 comments on commit f353458

Please sign in to comment.