Skip to content

Commit

Permalink
Finish writing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Jul 14, 2023
1 parent a364d8d commit e3d87a4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions testing/integration/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,13 +706,19 @@ func TestStandaloneUpgradeFailsRestart(t *testing.T) {

// Try upgrading to the fake Agent package.
t.Logf("Attempting upgrade to %s using Agent package at %s", toVersion.String(), packagePath)
time.Sleep(5 * time.Minute)
//ctx, _ = context.WithTimeout(ctx, 2*time.Minute)
//_, err = c.Upgrade(ctx, toVersion.String(), "file://"+packagePath, true)
//require.NoErrorf(t, err, "error triggering agent upgrade to version %q", toVersion.String())
ctx, _ = context.WithTimeout(ctx, 2*time.Minute)
_, err = c.Upgrade(ctx, toVersion.String(), "file://"+packagePath, true)
require.NoErrorf(t, err, "error triggering agent upgrade to version %q", toVersion.String())

// Ensure that the Upgrade Watcher has stopped running.
checkUpgradeWatcherRan(t, f)

// Ensure that the original version of Agent is running again.
t.Log("Check Agent version to ensure rollback is successful")
currentVersion, err := getVersion(t, ctx, f)
require.NoError(t, err)
require.Equal(t, fromVersion, currentVersion.Binary.Version)
require.Equal(t, fromVersion, currentVersion.Daemon.Version)
}

func createFakeBrokenAgentPackage(t *testing.T, version *version.ParsedSemVer) string {
Expand Down

0 comments on commit e3d87a4

Please sign in to comment.