diff --git a/tests/e2e/controller_test.go b/tests/e2e/controller_test.go index 1a69b107edc..c37fbacf66d 100644 --- a/tests/e2e/controller_test.go +++ b/tests/e2e/controller_test.go @@ -91,7 +91,7 @@ func NewTestContext() (*testContext, error) { customClient: custClient, operatorNamespace: opNamespace, applicationsNamespace: testDSCI.Spec.ApplicationsNamespace, - resourceCreationTimeout: time.Minute * 5, // since we introduce check for all deployment, we need prolong time here too and match what we set in the component + resourceCreationTimeout: time.Minute * 7, // since we introduce check for all deployment, we need prolong time here too and match what we set in the component resourceRetryInterval: time.Second * 10, ctx: context.TODO(), testDsc: testDSC, diff --git a/tests/e2e/creation_test.go b/tests/e2e/creation_test.go index 877b6b0a503..da79a786faa 100644 --- a/tests/e2e/creation_test.go +++ b/tests/e2e/creation_test.go @@ -283,13 +283,7 @@ func (tc *testContext) testAllApplicationCreation(t *testing.T) error { //nolint t.Parallel() err = tc.testApplicationCreation(c) - - msg := fmt.Sprintf("error validating application %v when ", name) - if c.GetManagementState() == operatorv1.Managed { - require.NoError(t, err, msg+"enabled") - } else { - require.Error(t, err, msg+"disabled") - } + require.NoError(t, err, "error validating application %v when "+c.GetManagementState()) }) } // Verify DSC instance is in Ready phase in the end when all components are up and running @@ -311,6 +305,11 @@ func (tc *testContext) testApplicationCreation(component components.ComponentInt return false, fmt.Errorf("error listing application deployments :%w", err) } if len(appList.Items) != 0 { + if component.GetManagementState() == operatorv1.Removed { + // deployment exists for removed component, retrying + return false, nil + } + for _, deployment := range appList.Items { if deployment.Status.ReadyReplicas < 1 { log.Printf("waiting for application deployments to be in Ready state.") @@ -320,6 +319,11 @@ func (tc *testContext) testApplicationCreation(component components.ComponentInt return true, nil } // when no deployment is found + // It's ok not to have deployements for unmanaged component + if component.GetManagementState() != operatorv1.Managed { + return true, nil + } + return false, nil })