From 01eae564788f9a06731a7650e569444c6de31b4f Mon Sep 17 00:00:00 2001 From: Jackson Owens Date: Thu, 20 Jan 2022 10:35:55 -0500 Subject: [PATCH] cmd/github-post: fix Pebble metamorphic reproduction command When posting a github issue for a Pebble metamorphic test failure, include the correct `-ops` flag. Release note: none --- build/teamcity-nightly-pebble-metamorphic.sh | 4 ++++ pkg/cmd/github-post/main.go | 2 +- pkg/cmd/github-post/main_test.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/teamcity-nightly-pebble-metamorphic.sh b/build/teamcity-nightly-pebble-metamorphic.sh index 2669913432f2..3c88d6164d6e 100755 --- a/build/teamcity-nightly-pebble-metamorphic.sh +++ b/build/teamcity-nightly-pebble-metamorphic.sh @@ -43,6 +43,10 @@ mkdir -p $ARTIFACTS_DIR # Use an `if` so that the `-e` option doesn't stop the script on error. pushd ./vendor/github.com/cockroachdb/pebble/internal/metamorphic if ! stdbuf -oL -eL \ + + # NB: If adjusting the metamorphic test flags below, be sure to also update + # pkg/cmd/github-post/main.go to ensure the GitHub issue poster includes the + # correct flags in the reproduction command. go test -mod=vendor -exec "stress ${STRESSFLAGS}" -run 'TestMeta$$' \ -timeout 0 -tags 'invariants' -test.v \ -dir $ARTIFACTS_DIR -ops "uniform:5000-25000" 2>&1 | tee $ARTIFACTS_DIR/metamorphic.log; then diff --git a/pkg/cmd/github-post/main.go b/pkg/cmd/github-post/main.go index 99ec5324538e..2bc68962904f 100644 --- a/pkg/cmd/github-post/main.go +++ b/pkg/cmd/github-post/main.go @@ -542,7 +542,7 @@ func formatPebbleMetamorphicIssue( s = strings.TrimSpace(s[:strings.Index(s, "\n")]) repro = fmt.Sprintf("go test -mod=vendor -tags 'invariants' -exec 'stress -p 1' "+ - "-timeout 0 -test.v -run TestMeta$ ./internal/metamorphic -seed %s", s) + `-timeout 0 -test.v -run TestMeta$ ./internal/metamorphic -seed %s -ops "uniform:5000-25000"`, s) } } return issues.UnitTestFormatter, issues.PostRequest{ diff --git a/pkg/cmd/github-post/main_test.go b/pkg/cmd/github-post/main_test.go index 0a24ee1702ea..fd07e64541e7 100644 --- a/pkg/cmd/github-post/main_test.go +++ b/pkg/cmd/github-post/main_test.go @@ -235,7 +235,7 @@ TestXXA - 1.00s testName: "TestMeta", title: "internal/metamorphic: TestMeta failed", message: "panic: induced panic", - expRepro: "go test -mod=vendor -tags 'invariants' -exec 'stress -p 1' -timeout 0 -test.v -run TestMeta$ ./internal/metamorphic -seed 1600209371838097000", + expRepro: `go test -mod=vendor -tags 'invariants' -exec 'stress -p 1' -timeout 0 -test.v -run TestMeta$ ./internal/metamorphic -seed 1600209371838097000 -ops "uniform:5000-25000"`, }, }, formatter: formatPebbleMetamorphicIssue,