Skip to content

Commit

Permalink
cmd/github-post: fix Pebble metamorphic reproduction command
Browse files Browse the repository at this point in the history
When posting a github issue for a Pebble metamorphic test failure, include the
correct `-ops` flag.

Release note: none
  • Loading branch information
jbowens committed Jan 20, 2022
1 parent e8a0b75 commit 01eae56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions build/teamcity-nightly-pebble-metamorphic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/github-post/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/github-post/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 01eae56

Please sign in to comment.