Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
111949: roachtest: randomly run with runtime assertions by default r=renatolabs,mikeCRL,rickystewart,herkolategan a=DarrylWong

This changes the semantics of `t.Cockroach()` to use a binary with runtime assertions enabled by default. Performance tests (indicated by the benchmark TestSpec) will be able to continue using the standard binary, without runtime assertions or metamorphic constants, as usual.

This commit also opts-out other tests that cannot easily be run with runtime assertions or metamorphic constants enabled, most often due to timeouts or metamorphic constant incompatibility.

Resolves #86678.
Informs #94986.

Epic: none

Release note: None

113693: go.mod: bump Pebble to 844f0582c2eb r=RaduBerinde a=itsbilal

```
844f0582 tool: fix tool to tolerate T in the log context
58cbdb46 internal/dsl: new package
481da041 db: add KeyStatistics.LatestKindsCount
86ec1c41 db: move size check for remote files to table stats job
424019fb db: guard against concurrent batch writes during Commit
5f131c12 db: default to zeroing fields in Batch.Reset
```

Release note: None.

Epic: none

Co-authored-by: Renato Costa <renato@cockroachlabs.com>
Co-authored-by: DarrylWong <darryl@cockroachlabs.com>
Co-authored-by: Bilal Akhtar <bilal@cockroachlabs.com>
  • Loading branch information
4 people committed Nov 2, 2023
3 parents e65bc94 + 01d34f5 + e47c2c8 commit 722f902
Show file tree
Hide file tree
Showing 37 changed files with 363 additions and 128 deletions.
6 changes: 3 additions & 3 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1599,10 +1599,10 @@ def go_deps():
patches = [
"@com_github_cockroachdb_cockroach//build/patches:com_github_cockroachdb_pebble.patch",
],
sha256 = "c948af2190175004b1286f196fb5463684a9988616d25d39e7c08ee15c0c1ec8",
strip_prefix = "github.com/cockroachdb/pebble@v0.0.0-20231031205119-df07a1e1c42c",
sha256 = "b7657d2bc7387522b996573787a2cdb6a8556ee8a2de39782c1893b79115b84c",
strip_prefix = "github.com/cockroachdb/pebble@v0.0.0-20231102162011-844f0582c2eb",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20231031205119-df07a1e1c42c.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20231102162011-844f0582c2eb.zip",
],
)
go_repository(
Expand Down
2 changes: 1 addition & 1 deletion build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/go-test-teamcity/com_github_cockroachdb_go_test_teamcity-v0.0.0-20191211140407-cff980ad0a55.zip": "bac30148e525b79d004da84d16453ddd2d5cd20528e9187f1d7dac708335674b",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/gostdlib/com_github_cockroachdb_gostdlib-v1.19.0.zip": "c4d516bcfe8c07b6fc09b8a9a07a95065b36c2855627cb3514e40c98f872b69e",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/logtags/com_github_cockroachdb_logtags-v0.0.0-20230118201751-21c54148d20b.zip": "ca7776f47e5fecb4c495490a679036bfc29d95bd7625290cfdb9abb0baf97476",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20231031205119-df07a1e1c42c.zip": "c948af2190175004b1286f196fb5463684a9988616d25d39e7c08ee15c0c1ec8",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20231102162011-844f0582c2eb.zip": "b7657d2bc7387522b996573787a2cdb6a8556ee8a2de39782c1893b79115b84c",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/redact/com_github_cockroachdb_redact-v1.1.5.zip": "11b30528eb0dafc8bc1a5ba39d81277c257cbe6946a7564402f588357c164560",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/returncheck/com_github_cockroachdb_returncheck-v0.0.0-20200612231554-92cdbca611dd.zip": "ce92ba4352deec995b1f2eecf16eba7f5d51f5aa245a1c362dfe24c83d31f82b",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/stress/com_github_cockroachdb_stress-v0.0.0-20220803192808-1806698b1b7b.zip": "3fda531795c600daf25532a4f98be2a1335cd1e5e182c72789bca79f5f69fcc1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ case "$component" in
;;
roachtest)
# Roachtest binary.
bazel_args=(//pkg/cmd/roachtest)
# N.B. We always compile the roachtest binary with crdb_test so the same serialization
# on the wire is established with cockroach binaries built under crdb_test.
# E.g. KVNemesisSeq is used only under crdb_test builds. If the cockroach binary is
# built with crdb_test, it will expect this field to be sent by the roachtest runner.
# Note that the opposite is not true, and a cockroach binary built without crdb_test
# is still compatible with a roachtest binary built with it.
bazel_args=(//pkg/cmd/roachtest --crdb_test)
artifacts=("pkg/cmd/roachtest/roachtest_/roachtest:bin/roachtest.$os-$arch")
;;
*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))"
source "$dir/teamcity-support.sh" # For $root
source "$dir/teamcity-bazel-support.sh" # For run_bazel

BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e LITERAL_ARTIFACTS_DIR=$root/artifacts -e AWS_ACCESS_KEY_ID -e AWS_ACCESS_KEY_ID_ASSUME_ROLE -e AWS_KMS_KEY_ARN_A -e AWS_KMS_KEY_ARN_B -e AWS_KMS_REGION_A -e AWS_KMS_REGION_B -e AWS_ROLE_ARN -e AWS_SECRET_ACCESS_KEY -e AWS_SECRET_ACCESS_KEY_ASSUME_ROLE -e BUILD_VCS_NUMBER -e CLOUD -e COCKROACH_DEV_LICENSE -e TESTS -e COUNT -e GITHUB_API_TOKEN -e GITHUB_ORG -e GITHUB_REPO -e GOOGLE_EPHEMERAL_CREDENTIALS -e SLACK_TOKEN -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL -e SELECT_PROBABILITY" \
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e LITERAL_ARTIFACTS_DIR=$root/artifacts -e AWS_ACCESS_KEY_ID -e AWS_ACCESS_KEY_ID_ASSUME_ROLE -e AWS_KMS_KEY_ARN_A -e AWS_KMS_KEY_ARN_B -e AWS_KMS_REGION_A -e AWS_KMS_REGION_B -e AWS_ROLE_ARN -e AWS_SECRET_ACCESS_KEY -e AWS_SECRET_ACCESS_KEY_ASSUME_ROLE -e BUILD_VCS_NUMBER -e CLOUD -e COCKROACH_DEV_LICENSE -e TESTS -e COUNT -e GITHUB_API_TOKEN -e GITHUB_ORG -e GITHUB_REPO -e GOOGLE_EPHEMERAL_CREDENTIALS -e SLACK_TOKEN -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL -e SELECT_PROBABILITY -e COCKROACH_RANDOM_SEED -e ROACHTEST_ASSERTIONS_ENABLED_SEED" \
run_bazel build/teamcity/cockroach/nightlies/roachtest_nightly_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))"
source "$dir/teamcity-support.sh" # For $root
source "$dir/teamcity-bazel-support.sh" # For run_bazel

BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e LITERAL_ARTIFACTS_DIR=$root/artifacts -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e AZURE_SUBSCRIPTION_ID -e AZURE_TENANT_ID -e BUILD_VCS_NUMBER -e CLOUD -e COCKROACH_DEV_LICENSE -e TESTS -e COUNT -e GITHUB_API_TOKEN -e GITHUB_ORG -e GITHUB_REPO -e GOOGLE_EPHEMERAL_CREDENTIALS -e SLACK_TOKEN -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL -e SELECT_PROBABILITY" \
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e LITERAL_ARTIFACTS_DIR=$root/artifacts -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e AZURE_SUBSCRIPTION_ID -e AZURE_TENANT_ID -e BUILD_VCS_NUMBER -e CLOUD -e COCKROACH_DEV_LICENSE -e TESTS -e COUNT -e GITHUB_API_TOKEN -e GITHUB_ORG -e GITHUB_REPO -e GOOGLE_EPHEMERAL_CREDENTIALS -e SLACK_TOKEN -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL -e SELECT_PROBABILITY -e COCKROACH_RANDOM_SEED -e ROACHTEST_ASSERTIONS_ENABLED_SEED" \
run_bazel build/teamcity/cockroach/nightlies/roachtest_nightly_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))"
source "$dir/teamcity-support.sh" # For $root
source "$dir/teamcity-bazel-support.sh" # For run_bazel

BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e LITERAL_ARTIFACTS_DIR=$root/artifacts -e BUILD_VCS_NUMBER -e CLOUD -e COCKROACH_DEV_LICENSE -e TESTS -e COUNT -e GITHUB_API_TOKEN -e GITHUB_ORG -e GITHUB_REPO -e GOOGLE_EPHEMERAL_CREDENTIALS -e GOOGLE_KMS_KEY_A -e GOOGLE_KMS_KEY_B -e GOOGLE_CREDENTIALS_ASSUME_ROLE -e GOOGLE_SERVICE_ACCOUNT -e SLACK_TOKEN -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL -e SELECT_PROBABILITY" \
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e LITERAL_ARTIFACTS_DIR=$root/artifacts -e BUILD_VCS_NUMBER -e CLOUD -e COCKROACH_DEV_LICENSE -e TESTS -e COUNT -e GITHUB_API_TOKEN -e GITHUB_ORG -e GITHUB_REPO -e GOOGLE_EPHEMERAL_CREDENTIALS -e GOOGLE_KMS_KEY_A -e GOOGLE_KMS_KEY_B -e GOOGLE_CREDENTIALS_ASSUME_ROLE -e GOOGLE_SERVICE_ACCOUNT -e SLACK_TOKEN -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e TC_BUILD_ID -e TC_SERVER_URL -e SELECT_PROBABILITY -e COCKROACH_RANDOM_SEED -e ROACHTEST_ASSERTIONS_ENABLED_SEED" \
run_bazel build/teamcity/cockroach/nightlies/roachtest_nightly_impl.sh
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ require (
github.com/cockroachdb/go-test-teamcity v0.0.0-20191211140407-cff980ad0a55
github.com/cockroachdb/gostdlib v1.19.0
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b
github.com/cockroachdb/pebble v0.0.0-20231031205119-df07a1e1c42c
github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb
github.com/cockroachdb/redact v1.1.5
github.com/cockroachdb/returncheck v0.0.0-20200612231554-92cdbca611dd
github.com/cockroachdb/stress v0.0.0-20220803192808-1806698b1b7b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ github.com/cockroachdb/gostdlib v1.19.0/go.mod h1:+dqqpARXbE/gRDEhCak6dm0l14AaTy
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/pebble v0.0.0-20231031205119-df07a1e1c42c h1:Fu7dhk7FKdUIc5uSBz4G7hbx4nXNOLDXmJZ5xxUYshE=
github.com/cockroachdb/pebble v0.0.0-20231031205119-df07a1e1c42c/go.mod h1:acMRUGd/BK8AUmQNK3spUCCGzFLZU2bSST3NMXSq2Kc=
github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb h1:6Po+YYKT5B5ZXN0wd2rwFBaebM0LufPf8p4zxOd48Kg=
github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb/go.mod h1:acMRUGd/BK8AUmQNK3spUCCGzFLZU2bSST3NMXSq2Kc=
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
Expand Down
54 changes: 49 additions & 5 deletions pkg/cmd/roachtest/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"fmt"
"io"
"io/fs"
"math/rand"
"net"
"net/url"
"os"
Expand Down Expand Up @@ -689,8 +690,13 @@ type clusterImpl struct {
// BAZEL_COVER_DIR will be set to this value when starting a node.
goCoverDir string

os string // OS of the cluster
arch vm.CPUArch // CPU architecture of the cluster
os string // OS of the cluster
arch vm.CPUArch // CPU architecture of the cluster
randomSeed struct {
mu syncutil.Mutex
seed *int64
}

// destroyState contains state related to the cluster's destruction.
destroyState destroyState
}
Expand Down Expand Up @@ -2003,10 +2009,16 @@ func (c *clusterImpl) StartE(

startOpts.RoachprodOpts.EncryptedStores = c.encAtRest

if !envExists(settings.Env, "COCKROACH_CRASH_ON_SPAN_USE_AFTER_FINISH") {
// Panic on span use-after-Finish, so we catch such bugs.
settings.Env = append(settings.Env, "COCKROACH_CRASH_ON_SPAN_USE_AFTER_FINISH=true")
setUnlessExists := func(name string, value interface{}) {
if !envExists(settings.Env, name) {
settings.Env = append(settings.Env, fmt.Sprintf("%s=%s", name, fmt.Sprint(value)))
}
}
// Panic on span use-after-Finish, so we catch such bugs.
setUnlessExists("COCKROACH_CRASH_ON_SPAN_USE_AFTER_FINISH", true)
// Set the same seed on every node, to be used by builds with
// runtime assertions enabled.
setUnlessExists("COCKROACH_RANDOM_SEED", c.cockroachRandomSeed())

// Needed for backward-compat on crdb_internal.ranges{_no_leases}.
// Remove in v23.2.
Expand Down Expand Up @@ -2071,6 +2083,38 @@ func (c *clusterImpl) RefetchCertsFromNode(ctx context.Context, node int) error
})
}

// SetRandomSeed sets the random seed to be used by the cluster. If
// not called, clusters generate a random seed from the global
// generator in the `rand` package. This function must be called
// before any nodes in the cluster start.
func (c *clusterImpl) SetRandomSeed(seed int64) {
c.randomSeed.seed = &seed
}

// cockroachRandomSeed returns the `COCKROACH_RANDOM_SEED` to be used
// by this cluster. The seed may have been previously set by a
// previous call to `StartE`, or by the user via `SetRandomSeed`. If
// not set, this function will generate a seed and return it.
func (c *clusterImpl) cockroachRandomSeed() int64 {
c.randomSeed.mu.Lock()
defer c.randomSeed.mu.Unlock()

// If the user provided a seed via environment variable, always use
// that, even if the test attempts to set a different seed.
if seedStr := os.Getenv(test.EnvAssertionsEnabledSeed); seedStr != "" {
seedOverride, err := strconv.ParseInt(seedStr, 0, 64)
if err != nil {
panic(fmt.Sprintf("error parsing %s: %s", test.EnvAssertionsEnabledSeed, err))
}
c.randomSeed.seed = &seedOverride
} else if c.randomSeed.seed == nil {
seed := rand.Int63()
c.randomSeed.seed = &seed
}

return *c.randomSeed.seed
}

// Start is like StartE() except that it will fatal the test on error.
func (c *clusterImpl) Start(
ctx context.Context,
Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/roachtest/cluster/cluster_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ type Cluster interface {
ctx context.Context, content, dest string, mode os.FileMode, opts ...option.Option,
) error

// SetRandomSeed allows tests to set their own random seed to be
// used by builds with runtime assertions enabled.
SetRandomSeed(seed int64)

// Starting and stopping CockroachDB.

StartE(ctx context.Context, l *logger.Logger, startOpts option.StartOpts, settings install.ClusterSettings, opts ...option.Option) error
Expand Down
6 changes: 5 additions & 1 deletion pkg/cmd/roachtest/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ func (t testWrapper) Cockroach() string {
return "./dummy-path/to/cockroach"
}

func (t testWrapper) CockroachShort() string {
func (t testWrapper) StandardCockroach() string {
return "./dummy-path/to/cockroach"
}

func (t testWrapper) RuntimeAssertionsCockroach() string {
return "./dummy-path/to/cockroach-short"
}

Expand Down
11 changes: 7 additions & 4 deletions pkg/cmd/roachtest/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/registry"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/spec"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/tests"
"github.com/cockroachdb/cockroach/pkg/internal/team"
rperrors "github.com/cockroachdb/cockroach/pkg/roachprod/errors"
"github.com/cockroachdb/cockroach/pkg/roachprod/logger"
Expand Down Expand Up @@ -139,6 +140,7 @@ func (g *githubIssues) createPostRequest(
spec *registry.TestSpec,
firstFailure failure,
message string,
metamorphicBuild bool,
) (issues.PostRequest, error) {
var mention []string
var projColID int
Expand Down Expand Up @@ -205,9 +207,10 @@ func (g *githubIssues) createPostRequest(
artifacts := fmt.Sprintf("/%s", testName)

clusterParams := map[string]string{
roachtestPrefix("cloud"): spec.Cluster.Cloud,
roachtestPrefix("cpu"): fmt.Sprintf("%d", spec.Cluster.CPUs),
roachtestPrefix("ssd"): fmt.Sprintf("%d", spec.Cluster.SSDs),
roachtestPrefix("cloud"): spec.Cluster.Cloud,
roachtestPrefix("cpu"): fmt.Sprintf("%d", spec.Cluster.CPUs),
roachtestPrefix("ssd"): fmt.Sprintf("%d", spec.Cluster.SSDs),
roachtestPrefix("metamorphicBuild"): fmt.Sprintf("%t", metamorphicBuild),
}
// Emit CPU architecture only if it was specified; otherwise, it's captured below, assuming cluster was created.
if spec.Cluster.Arch != "" {
Expand Down Expand Up @@ -256,7 +259,7 @@ func (g *githubIssues) MaybePost(t *testImpl, l *logger.Logger, message string)
return nil
}

postRequest, err := g.createPostRequest(t.Name(), t.start, t.end, t.spec, t.firstFailure(), message)
postRequest, err := g.createPostRequest(t.Name(), t.start, t.end, t.spec, t.firstFailure(), message, tests.UsingRuntimeAssertions(t))
if err != nil {
return err
}
Expand Down
71 changes: 38 additions & 33 deletions pkg/cmd/roachtest/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func TestCreatePostRequest(t *testing.T) {
clusterCreationFailed bool
loadTeamsFailed bool
localSSD bool
metamorphicBuild bool
extraLabels []string
arch vm.CPUArch
failure failure
Expand All @@ -140,55 +141,59 @@ func TestCreatePostRequest(t *testing.T) {
expectedSkipTestFailure bool
expectedParams map[string]string
}{
{true, false, false, false, nil, "", createFailure(errors.New("other")), true, false, false,
{true, false, false, false, false, nil, "", createFailure(errors.New("other")), true, false, false,
prefixAll(map[string]string{
"cloud": "gce",
"encrypted": "false",
"fs": "ext4",
"ssd": "0",
"cpu": "4",
"arch": "amd64",
"localSSD": "false",
"cloud": "gce",
"encrypted": "false",
"fs": "ext4",
"ssd": "0",
"cpu": "4",
"arch": "amd64",
"localSSD": "false",
"metamorphicBuild": "false",
}),
},
{true, false, false, true, nil, vm.ArchARM64, createFailure(errClusterProvisioningFailed), true, false, true,
{true, false, false, true, true, nil, vm.ArchARM64, createFailure(errClusterProvisioningFailed), true, false, true,
prefixAll(map[string]string{
"cloud": "gce",
"encrypted": "false",
"fs": "ext4",
"ssd": "0",
"cpu": "4",
"arch": "arm64",
"localSSD": "true",
"cloud": "gce",
"encrypted": "false",
"fs": "ext4",
"ssd": "0",
"cpu": "4",
"arch": "arm64",
"localSSD": "true",
"metamorphicBuild": "true",
}),
},
// Assert that release-blocker label doesn't exist when
// !nonReleaseBlocker and issue is an SSH flake. Also ensure that
// in the event of a failed cluster creation, nil `vmOptions` and
// `clusterImpl` are not dereferenced
{false, true, false, false, nil, "", createFailure(rperrors.ErrSSH255), true, false, true,
{false, true, false, false, false, nil, "", createFailure(rperrors.ErrSSH255), true, false, true,
prefixAll(map[string]string{
"cloud": "gce",
"ssd": "0",
"cpu": "4",
"cloud": "gce",
"ssd": "0",
"cpu": "4",
"metamorphicBuild": "false",
}),
},
//Simulate failure loading TEAMS.yaml
{true, false, true, false, nil, "", createFailure(errors.New("other")), false, false, false, nil},
{true, false, true, false, false, nil, "", createFailure(errors.New("other")), false, false, false, nil},
//Error during post test assertions
{true, false, false, false, nil, "", createFailure(errDuringPostAssertions), false, false, false, nil},
{true, false, false, false, false, nil, "", createFailure(errDuringPostAssertions), false, false, false, nil},
//Error during dns operation
{true, false, false, false, nil, "", createFailure(gce.ErrDNSOperation), true, false, true, nil},
{true, false, false, false, false, nil, "", createFailure(gce.ErrDNSOperation), true, false, true, nil},
// Assert that extra labels in the test spec are added to the issue.
{true, false, false, false, []string{"foo-label"}, "", createFailure(errors.New("other")), true, false, false,
{true, false, false, false, false, []string{"foo-label"}, "", createFailure(errors.New("other")), true, false, false,
prefixAll(map[string]string{
"cloud": "gce",
"encrypted": "false",
"fs": "ext4",
"ssd": "0",
"cpu": "4",
"arch": "amd64",
"localSSD": "false",
"cloud": "gce",
"encrypted": "false",
"fs": "ext4",
"ssd": "0",
"cpu": "4",
"arch": "amd64",
"localSSD": "false",
"metamorphicBuild": "false",
}),
},
}
Expand Down Expand Up @@ -239,10 +244,10 @@ func TestCreatePostRequest(t *testing.T) {

if c.loadTeamsFailed {
// Assert that if TEAMS.yaml cannot be loaded then function errors.
_, err := github.createPostRequest("github_test", ti.start, ti.end, testSpec, c.failure, "message")
_, err := github.createPostRequest("github_test", ti.start, ti.end, testSpec, c.failure, "message", c.metamorphicBuild)
assert.Error(t, err, "Expected an error in createPostRequest when loading teams fails, but got nil")
} else {
req, err := github.createPostRequest("github_test", ti.start, ti.end, testSpec, c.failure, "message")
req, err := github.createPostRequest("github_test", ti.start, ti.end, testSpec, c.failure, "message", c.metamorphicBuild)
assert.NoError(t, err, "Expected no error in createPostRequest")

r := &issues.Renderer{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ func UploadVersion(
newVersion *Version,
) (string, error) {
dstBinary := BinaryPathForVersion(t, newVersion)
srcBinary := t.Cockroach()
// Run with standard binary as older versions retrieved through roachprod stage
// are not currently available with crdb_test enabled.
// TODO(DarrylWong): Compile older versions with crdb_test flag.
srcBinary := t.StandardCockroach()

overrideBinary, isOverriden := t.VersionsBinaryOverride()[newVersion.String()]
if isOverriden {
Expand Down
Loading

0 comments on commit 722f902

Please sign in to comment.