Skip to content

Commit

Permalink
roachtest: automate and de-flake version-upgrade
Browse files Browse the repository at this point in the history
The recent changes to this test seem to have uncovered a latent [bug],
as a result of which the test was skipped. This commit lets the test
start from v19.2 fixtures (instead of v19.1 before) which experimentally
were verified to not exhibit the bug, so the test is unskipped.

While I was there, I automated the base version discovery of this test.
On a branch at version X, the test will now use the fixtures for the
last major release preceding X. We'll occasionally have to bake new
fixtures and update the mapping in PredecessorVersion() but this is
better than having the test rot on older branches whenever we update
it for a new dev cycle.

The root cause of the bug will be fixed separately; this is tracked in
issue cockroachdb#44732.

[bug]: cockroachdb#47235 (comment)

Release note: None
  • Loading branch information
tbg committed Apr 9, 2020
1 parent bab6e64 commit 8f1ebe4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 7 additions & 2 deletions pkg/cmd/roachtest/acceptance.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ func registerAcceptance(r *testRegistry) {
{name: "status-server", fn: runStatusServer},
{
name: "version-upgrade",
fn: runVersionUpgrade,
skip: "skipped due to flakiness",
fn: func(ctx context.Context, t *test, c *cluster) {
predV, err := PredecessorVersion(r.buildVersion)
if err != nil {
t.Fatal(err)
}
runVersionUpgrade(ctx, t, c, predV)
},
// This test doesn't like running on old versions because it upgrades to
// the latest released version and then it tries to "head", where head is
// the cockroach binary built from the branch on which the test is
Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/roachtest/versionupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,20 @@ const (
headVersion = "HEAD"
)

func runVersionUpgrade(ctx context.Context, t *test, c *cluster) {
func runVersionUpgrade(ctx context.Context, t *test, c *cluster, predecessorVersion string) {
// This is ugly, but we can't pass `--encrypt=false` to old versions of
// Cockroach.
//
// TODO(tbg): revisit as old versions are aged out of this test.
c.encryptDefault = false

const baseVersion = "19.1.5"
u := newVersionUpgradeTest(c, versionUpgradeTestFeatures,
// Load baseVersion fixture. That fixture's cluster version may be
// at the predecessor version, so add a waitForUpgradeStep to make
// sure we're actually running at baseVersion before moving on.
//
// See the comment on createCheckpoints for details on fixtures.
uploadAndStartFromCheckpointFixture(baseVersion),
uploadAndStartFromCheckpointFixture(predecessorVersion),
waitForUpgradeStep(),

// NB: before the next step, cluster and binary version equals baseVersion,
Expand Down

0 comments on commit 8f1ebe4

Please sign in to comment.