diff --git a/test/e2e/upgrade/upgrade.go b/test/e2e/upgrade/upgrade.go index a9ddadab7d8d..16b3690fafcf 100644 --- a/test/e2e/upgrade/upgrade.go +++ b/test/e2e/upgrade/upgrade.go @@ -258,8 +258,18 @@ func clusterUpgrade(f *framework.Framework, c configv1client.Interface, dc dynam // this is very long. We should update the clusteroperator junit to give us a duration. maximumDuration := 150 * time.Minute - // if upgrades take longer than this, then we will have a junit marker indicating failure. - durationToSoftFailure := 75 * time.Minute + baseDurationToSoftFailure := 75 * time.Minute + durationToSoftFailure := baseDurationToSoftFailure + + network, err := c.ConfigV1().Networks().Get(context.Background(), "cluster", metav1.GetOptions{}) + framework.ExpectNoError(err) + if network.Status.NetworkType == "OVNKubernetes" { + // deploying with OVN is expected to take longer. on average, ~15m longer + // some extra context to this increase which links to a jira showing which operators take longer: + // compared to OpenShiftSDN: + // https://bugzilla.redhat.com/show_bug.cgi?id=1942164 + durationToSoftFailure = baseDurationToSoftFailure + (15 * time.Minute) + } framework.Logf("Starting upgrade to version=%s image=%s", version.Version.String(), version.NodeImage) @@ -271,9 +281,11 @@ func clusterUpgrade(f *framework.Framework, c configv1client.Interface, dc dynam case upgradeAbortAtRandom: abortAt = int(rand.Int31n(100) + 1) maximumDuration *= 2 + durationToSoftFailure *= 2 framework.Logf("Upgrade will be aborted and the cluster will roll back to the current version after %d%% of operators have upgraded (picked randomly)", abortAt) default: maximumDuration *= 2 + durationToSoftFailure *= 2 framework.Logf("Upgrade will be aborted and the cluster will roll back to the current version after %d%% of operators have upgraded", upgradeAbortAt) } @@ -346,6 +358,7 @@ func clusterUpgrade(f *framework.Framework, c configv1client.Interface, dc dynam func() error { framework.Logf("Cluster version operator acknowledged upgrade request") aborted := false + action := "upgrade" var lastMessage string upgradeStarted := time.Now() @@ -379,6 +392,7 @@ func clusterUpgrade(f *framework.Framework, c configv1client.Interface, dc dynam return false, err } aborted = true + action = "aborted upgrade" return false, nil } @@ -386,21 +400,22 @@ func clusterUpgrade(f *framework.Framework, c configv1client.Interface, dc dynam }); err != nil { if lastMessage != "" { - return fmt.Errorf("Cluster did not complete upgrade: %v: %s", err, lastMessage) + return fmt.Errorf("Cluster did not complete %s: %v: %s", action, err, lastMessage) } - return fmt.Errorf("Cluster did not complete upgrade: %v", err) + return fmt.Errorf("Cluster did not complete %s: %v", action, err) } - framework.Logf("Completed upgrade to %s", versionString(desired)) + framework.Logf("Completed %s to %s", action, versionString(desired)) // record whether the cluster was fast or slow upgrading. Don't fail the test, we still want signal on the actual tests themselves. upgradeEnded := time.Now() upgradeDuration := upgradeEnded.Sub(upgradeStarted) + testCaseName := fmt.Sprintf("[sig-cluster-lifecycle] cluster upgrade should complete in %0.2f minutes", durationToSoftFailure.Minutes()) + failure := "" if upgradeDuration > durationToSoftFailure { - disruption.RecordJUnitResult(f, "[sig-cluster-lifecycle] cluster upgrade should be fast", upgradeDuration, fmt.Sprintf("Upgrade took too long: %v", upgradeDuration.Minutes())) - } else { - disruption.RecordJUnitResult(f, "[sig-cluster-lifecycle] cluster upgrade should be fast", upgradeDuration, "") + failure = fmt.Sprintf("%s to %s took too long: %0.2f minutes", action, versionString(desired), upgradeDuration.Minutes()) } + disruption.RecordJUnitResult(f, testCaseName, upgradeDuration, failure) return nil },