Skip to content

Commit 85bc357

Browse files
craig[bot]tbg
andcommitted
Merge #151177
151177: roachtest: use import instead of fixtures for bank test r=pav-kv a=tbg Fixes #151017, #151274 Epic: none Co-authored-by: Tobias Grieger <[email protected]>
2 parents 43c294e + dc58fc3 commit 85bc357

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

pkg/cmd/roachtest/tests/copy.go

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,18 @@ import (
1717
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/cluster"
1818
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/option"
1919
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/registry"
20-
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/spec"
2120
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
2221
"github.com/cockroachdb/cockroach/pkg/roachprod/install"
2322
"github.com/cockroachdb/errors"
2423
)
2524

26-
// we need to hardcode the random seed when loading fixtures since
27-
// that references a static bucket in GCS
28-
const fixturesRandomSeed = 1
29-
3025
func registerCopy(r registry.Registry) {
3126
// This test imports a fully-populated Bank table. It then creates an empty
3227
// Bank schema. Finally, it performs a series of `INSERT ... SELECT ...`
3328
// statements to copy all data from the first table into the second table.
3429
runCopy := func(ctx context.Context, t test.Test, c cluster.Cluster, rows int, inTxn bool) {
3530
// payload is the size of the payload column for each row in the Bank
36-
// table. If this is adjusted, a new fixture may need to be generated.
31+
// table.
3732
const payload = 100
3833
// rowOverheadEstimate is an estimate of the overhead of a single
3934
// row in the Bank table, not including the size of the payload
@@ -58,10 +53,10 @@ func registerCopy(r registry.Registry) {
5853
return errors.Wrap(err, "disabling load-based splitting")
5954
}
6055

61-
t.Status("importing Bank fixture")
56+
t.Status("importing bank table")
6257
c.Run(ctx, option.WithNodes(c.Node(1)), fmt.Sprintf(
63-
"./cockroach workload fixtures load bank --rows=%d --payload-bytes=%d --seed %d {pgurl:1}",
64-
rows, payload, fixturesRandomSeed))
58+
"./cockroach workload init bank --data-loader=IMPORT --rows=%d --payload-bytes=%d --seed 123 {pgurl:1}",
59+
rows, payload))
6560
if _, err := db.Exec("ALTER TABLE bank.bank RENAME TO bank.bank_orig"); err != nil {
6661
t.Fatalf("failed to rename table: %v", err)
6762
}
@@ -175,13 +170,11 @@ func registerCopy(r registry.Registry) {
175170
for _, tc := range testcases {
176171
tc := tc
177172
r.Add(registry.TestSpec{
178-
Name: fmt.Sprintf("copy/bank/rows=%d,nodes=%d,txn=%t", tc.rows, tc.nodes, tc.txn),
179-
Owner: registry.OwnerKV,
180-
Cluster: r.MakeClusterSpec(tc.nodes),
181-
// Uses gs://cockroach-fixtures-us-east1. See:
182-
// https://github.com/cockroachdb/cockroach/issues/105968
183-
CompatibleClouds: registry.Clouds(spec.GCE, spec.Local),
173+
Name: fmt.Sprintf("copy/bank/rows=%d,nodes=%d,txn=%t", tc.rows, tc.nodes, tc.txn),
174+
Owner: registry.OwnerKV,
175+
Cluster: r.MakeClusterSpec(tc.nodes),
184176
Suites: registry.Suites(registry.Nightly),
177+
CompatibleClouds: registry.AllClouds,
185178
Leases: registry.MetamorphicLeases,
186179
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
187180
runCopy(ctx, t, c, tc.rows, tc.txn)

0 commit comments

Comments
 (0)