From 8466890be564f77b406640f359a942dd5123a51d Mon Sep 17 00:00:00 2001 From: Mikalai Radchuk <509198+m1kola@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:44:23 +0200 Subject: [PATCH] Fix a flake in upgrade e2e (#1346) There is a potential for nil pointer dereference in the test. This change adds condition to check for nil. Signed-off-by: Mikalai Radchuk --- test/upgrade-e2e/post_upgrade_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/upgrade-e2e/post_upgrade_test.go b/test/upgrade-e2e/post_upgrade_test.go index 8bb2ae3df..382da5cbf 100644 --- a/test/upgrade-e2e/post_upgrade_test.go +++ b/test/upgrade-e2e/post_upgrade_test.go @@ -86,7 +86,7 @@ func TestClusterExtensionAfterOLMUpgrade(t *testing.T) { assert.Equal(ct, metav1.ConditionTrue, cond.Status) assert.Equal(ct, ocv1alpha1.ReasonSuccess, cond.Reason) assert.Contains(ct, cond.Message, "Installed bundle") - if assert.NotEmpty(ct, clusterExtension.Status.Install.Bundle) { + if assert.NotNil(ct, clusterExtension.Status.Install) { assert.NotEmpty(ct, clusterExtension.Status.Install.Bundle.Version) } }, time.Minute, time.Second)