Fix flakey upgrade integration test (#3329)

The `linkerd upgrade` integration test compares the output from two
commands:
- `linkerd upgrade control-plane`
- `linkerd upgrade control-plane --from-manifests`

The output of these commands include the heartbeat cronjob schedule,
which is generated based on the current time.

Modify the upgrade integration test to retry the manifest comparison one
time, assuming that `linkerd upgrade control-plane` should not take more
than one minute to execute.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
This commit is contained in:
Andrew Seigner 2019-08-28 09:41:09 -07:00 committed by GitHub
parent 981f5bc85d
commit 419e9052ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -204,10 +204,19 @@ func TestInstallOrUpgradeCli(t *testing.T) {
t.Fatalf("linkerd upgrade --from-manifests command failed with %s\n%s\n%s", err, stderr, upgradeFromManifests)
}
if out != upgradeFromManifests {
// retry in case it's just a discrepancy in the heartbeat cron schedule
exec := append([]string{cmd}, args...)
out, _, err := TestHelper.LinkerdRun(exec...)
if err != nil {
t.Fatalf("command failed: %v\n%s", exec, out)
}
if out != upgradeFromManifests {
t.Fatalf("manifest upgrade differs from k8s upgrade.\nk8s upgrade:\n%s\nmanifest upgrade:\n%s", out, upgradeFromManifests)
}
}
}
out, err = TestHelper.KubectlApply(out, "")
if err != nil {