Skip to content

Commit a6f6684

Browse files
committed
dev: add deadlock detector support to roachprod-stress
This adds a new `--deadlock` flag to the `dev roachprod-stress` command, which enables the deadlock detector in the stressed test(s). Epic: none Release note: None
1 parent 4c39761 commit a6f6684

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/cmd/dev/roachprod_stress.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func makeRoachprodStressCmd(runE func(cmd *cobra.Command, args []string) error)
3939
roachprodStressCmd.Flags().String(volumeFlag, "bzlhome", "the Docker volume to use as the container home directory (only used for cross builds)")
4040
roachprodStressCmd.Flags().String(clusterFlag, "", "the name of the cluster (must be set)")
4141
roachprodStressCmd.Flags().Bool(raceFlag, false, "run tests using race builds")
42+
roachprodStressCmd.Flags().Bool(deadlockFlag, false, "run tests using the deadlock detector")
4243
return roachprodStressCmd
4344
}
4445

@@ -48,6 +49,7 @@ func (d *dev) roachprodStress(cmd *cobra.Command, commandLine []string) error {
4849
cluster = mustGetFlagString(cmd, clusterFlag)
4950
volume = mustGetFlagString(cmd, volumeFlag)
5051
race = mustGetFlagBool(cmd, raceFlag)
52+
deadlock = mustGetFlagBool(cmd, deadlockFlag)
5153
stressCmdArgs = mustGetFlagString(cmd, stressArgsFlag)
5254
)
5355
if cluster == "" {
@@ -109,6 +111,9 @@ func (d *dev) roachprodStress(cmd *cobra.Command, commandLine []string) error {
109111
if race {
110112
crossArgs = append(crossArgs, "--config=race")
111113
}
114+
if deadlock {
115+
crossArgs = append(crossArgs, "--define", "gotags=bazel,gss,deadlock")
116+
}
112117
err = d.crossBuild(ctx, crossArgs, targets, "crosslinux", volume, nil)
113118
if err != nil {
114119
return err

0 commit comments

Comments
 (0)