Skip to content

Commit

Permalink
roachtest: simplify version-upgrade
Browse files Browse the repository at this point in the history
The code to get the cluster version was already written, so reuse it.

Release note: None
  • Loading branch information
tbg committed Apr 9, 2020
1 parent 0222b51 commit bab6e64
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/cmd/roachtest/versionupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,11 @@ func waitForUpgradeStep() versionStep {

for i := 1; i <= c.spec.NodeCount; i++ {
err := retry.ForDuration(30*time.Second, func() error {
db := u.conn(ctx, t, i)

var currentVersion string
if err := db.QueryRow("SHOW CLUSTER SETTING version").Scan(&currentVersion); err != nil {
t.Fatalf("%d: %s", i, err)
}
currentVersion := u.clusterVersion(ctx, t, i).String()
if currentVersion != newVersion {
return fmt.Errorf("%d: expected version %s, got %s", i, newVersion, currentVersion)
}
t.l.Printf("%s: acked by n%d", currentVersion, i)
return nil
})
if err != nil {
Expand Down

0 comments on commit bab6e64

Please sign in to comment.