Skip to content

roachtest: make --workload optional#70059

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:roachtest-make-workload-optional
Sep 14, 2021
Merged

roachtest: make --workload optional#70059
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:roachtest-make-workload-optional

Conversation

@mgartner
Copy link
Copy Markdown
Contributor

This commit makes the --workload flag optional because some roachtests
do not require a workload binary.

Release note: None

@mgartner mgartner requested a review from a team as a code owner September 10, 2021 21:48
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@otan otan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think some roachtest invocations rely on not specifying a workload binary flag, in which case findBinary would look in the "default places" for the workload binary. in other words, this would break invocations such as bin/roachtest run tpcc/multiregion/survive=region/chaos=true which relies on findBinary to find the "default" locations.

seems like a gotcha to me, maybe --skip-workload-binary if we don't want it included? or have an object that keeps track of whether the workload binary was initialised, and when we try scp that binary across then we panic? or maybe more effort than it's worth.

@tbg
Copy link
Copy Markdown
Member

tbg commented Sep 13, 2021

+1, findBinary also provides the default value (for better or worse), how about reverting to the old code but then return a sentinel error instead of this one

return "", fmt.Errorf("failed to find %q in $PATH or any of %s", name, dirs)

and then here

workload, err = findBinary(workload, "workload")
if err != nil {
fmt.Fprintf(os.Stderr, "%+v\n", err)
os.Exit(1)
}

you detect that error and print something like "workload binary not provided, proceeding anyway" instead of exiting.

@mgartner mgartner force-pushed the roachtest-make-workload-optional branch from 148821d to cbe6a9c Compare September 13, 2021 15:15
@mgartner
Copy link
Copy Markdown
Contributor Author

I see, thanks for the additional context. I've made the suggestions @tbg suggested.

@blathers-crl blathers-crl bot requested a review from otan September 13, 2021 15:16
This commit makes the `--workload` flag optional because some roachtests
do not require a workload binary.

Release note: None
@mgartner mgartner force-pushed the roachtest-make-workload-optional branch from cbe6a9c to aae7c56 Compare September 13, 2021 21:25
Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker and @otan)

@mgartner
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 14, 2021

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 14, 2021

Build succeeded:

@craig craig bot merged commit 980b49d into cockroachdb:master Sep 14, 2021
@mgartner mgartner deleted the roachtest-make-workload-optional branch September 15, 2021 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants