Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for component deletion, Add --wait flag to odo delete #2732

Merged
merged 2 commits into from Apr 14, 2020

Conversation

adisky
Copy link
Contributor

@adisky adisky commented Mar 19, 2020

What type of PR is this?
/kind feature

What does does this PR do / why we need it:
It adds --wait flag in odo component delete, which waits for component and its dependents to get deleted. with foregroundDeletionPolicy kubernetes deletes the dependent first which are referring dc with ownerReference. Then it deletes the dc itself. we have added watch to dc so that it waits for deletion of dc

Which issue(s) this PR fixes:

Fixes #2682

How to test changes / Special notes to the reviewer:
Run odo delete -f -w on a deployed component,
Run oc get pvc, check th s2i pvc gets deleted
Run oc get route, check the route created via url gets deleted

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Mar 19, 2020
@adisky adisky requested review from cdrage and mik-dass March 19, 2020 08:48
@adisky adisky force-pushed the fix-deletion branch 3 times, most recently from d2c8f45 to 186d9c4 Compare March 19, 2020 11:01
@adisky adisky changed the title Wait for component deletion, Add --wait flag to odo delete [WIP Wait for component deletion, Add --wait flag to odo delete Mar 19, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Mar 19, 2020
@codecov
Copy link

codecov bot commented Mar 19, 2020

Codecov Report

Merging #2732 into master will decrease coverage by 0.22%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2732      +/-   ##
==========================================
- Coverage   43.67%   43.45%   -0.23%     
==========================================
  Files          95       97       +2     
  Lines        8762     8812      +50     
==========================================
+ Hits         3827     3829       +2     
- Misses       4571     4615      +44     
- Partials      364      368       +4     
Impacted Files Coverage Δ
pkg/application/application.go 41.26% <0.00%> (ø)
pkg/component/component.go 23.78% <0.00%> (ø)
pkg/occlient/occlient.go 51.78% <0.00%> (-0.93%) ⬇️
pkg/watch/watch.go 63.52% <0.00%> (-5.89%) ⬇️
...g/devfile/adapters/kubernetes/component/adapter.go 27.88% <0.00%> (ø)
pkg/devfile/parser/context.go
pkg/devfile/parser/fs.go
pkg/devfile/versions/versions.go
pkg/devfile/parser/schema.go
pkg/devfile/writer.go
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cef105b...9f3ed5b. Read the comment docs.

@adisky adisky force-pushed the fix-deletion branch 2 times, most recently from 7d97ff0 to 1b93056 Compare March 19, 2020 16:38
@adisky
Copy link
Contributor Author

adisky commented Mar 20, 2020

/retest

@adisky adisky changed the title [WIP Wait for component deletion, Add --wait flag to odo delete Wait for component deletion, Add --wait flag to odo delete Mar 20, 2020
@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. labels Mar 20, 2020
@amitkrout
Copy link
Contributor

How to test changes / Special notes to the reviewer:
Run odo delete -f -w on a deployed component, Immediately run odo push, it should not fail now with alreadyexist error as odo delete -f -w would wait for deletion to get completed.

@adisky Are you verifying the steps or torturing the code 🗡 hahaha....
I would say add steps which are easy to understand, user facing and more importantly use these steps in integration spec.

@amitkrout
Copy link
Contributor

@adisky Please cleanup What type of PR is this?

helper.CmdShouldPass("odo", "url", "create", "example-1", "--context", context)
helper.CmdShouldPass("odo", "storage", "create", "storage-name-1", "--size", "1Gi", "--path", "/data-1", "--context", context)
helper.CmdShouldPass("odo", append(args, "push", "--context", context)...)
// delete with --wait flag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adisky Deleting these lines may cause some real functionality validation miss. These lines were added due to some reason may be to catch any regression for specific scenario. IMO create a separate spec to verify your changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitkrout this test was not catching any regression, This line would always be true. https://github.com/openshift/odo/blob/master/tests/helper/helper_oc.go#L458
I have fixed the test case and removed not necessary checks. Please check the regression it missed
#2710
#2693

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can run the test case manually in verbose mode, and verify it is passing even if the pvc still exist, however it should fail here https://github.com/openshift/odo/blob/master/tests/integration/component.go#L846

Copy link
Contributor

@amitkrout amitkrout Mar 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adisky Understood, but tbh you are destroying one existing scenario with your changes. Why i am saying because the scenario is

create component 
create url
Create storage
odo push
create url
create storage
odo push
normal delete component 

And you are skipping steps of url create, storage create and push. IIRC the steps of url create,storage create and push twice was to catch some short failure. So don't skip those steps. Rest script changes looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitkrout sure i would add it, but we cannot add storage as of now, due to #2710

@adisky
Copy link
Contributor Author

adisky commented Mar 21, 2020

How to test changes / Special notes to the reviewer:
Run odo delete -f -w on a deployed component, Immediately run odo push, it should not fail now with alreadyexist error as odo delete -f -w would wait for deletion to get completed.

@adisky Are you verifying the steps or torturing the code hahaha....
I would say add steps which are easy to understand, user facing and more importantly use these steps in integration spec.

@amitkrout Please check the reported issue. it is signifying running odo push just after odo delete, however i have simplified

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Mar 23, 2020
@adisky adisky force-pushed the fix-deletion branch 2 times, most recently from 588fd6e to e4a132b Compare March 23, 2020 11:08
@amitkrout
Copy link
Contributor

/test v4.1-integration-e2e-benchmark

@amitkrout
Copy link
Contributor

/test v4.2-integration-e2e-benchmark

@adisky
Copy link
Contributor Author

adisky commented Mar 24, 2020

/test v4.1-integration-e2e-benchmark

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Apr 1, 2020
@girishramnani
Copy link
Contributor

@adisky any update on this?

Added --wait flag to odo delete
added propgation policy for deletion, setup watch on dc to recieve
deleted event.
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Apr 8, 2020
@adisky adisky force-pushed the fix-deletion branch 2 times, most recently from d9aa234 to fc1c72c Compare April 8, 2020 10:54
@adisky
Copy link
Contributor Author

adisky commented Apr 8, 2020

@adisky any update on this?

yes updated it.

oc.VerifyResourceDeleted("routes", "example", project)
oc.VerifyResourceDeleted("service", cmpName, project)
// verify s2i pvc is delete
oc.VerifyResourceDeleted("pvc", "s2idata", project)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are three PVCs, we need to check if all of them are deleted

Running oc with args [oc get pvc --namespace twmwqqprru]
[oc] NAME                  STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS    AGE
[oc] mvfzn-hgfxb-s2idata   Bound     pvc-jdslkaj-9f92-ljajlds          1Gi        RWO            gp2-encrypted   1m
[oc] storage-1-hgfxb-pvc   Bound     pvc-dasjldj-9f92-dhfhd           1Gi        RWO            gp2-encrypted   1m
[oc] storage-2-hgfxb-pvc   Bound     pvc-jsalkjd-9f92-lksala           1Gi        RWO            gp2-encrypted   44s

Copy link
Contributor Author

@adisky adisky Apr 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminding, added

Added Integration test for owned resource deletion.
Copy link
Contributor

@mik-dass mik-dass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me locally
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 9, 2020
tests/helper/helper_oc.go Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 9, 2020
@adisky
Copy link
Contributor Author

adisky commented Apr 9, 2020

@amitkrout raw test logs, in case resource exist, test should fail.

odo sub component command tests odo component delete should clean owned resources 
  should delete the component and the owned resources with wait flag
  /home/adisky/go/src/github.com/openshift/odo/tests/integration/component.go:858
Created dir: /tmp/234650130
Creating a new project: fgqbtmujjt
Running odo with args [odo project create fgqbtmujjt -w -v4]
[odo] I0409 14:46:20.352890   18863 preference.go:165] The path for preference file is /tmp/234650130/config.yaml
[odo]  •  Waiting for project to come up  ...
[odo] I0409 14:46:21.186053   18863 occlient.go:531] Status of creation of project fgqbtmujjt is Active
[odo] I0409 14:46:21.186128   18863 occlient.go:536] Project fgqbtmujjt now exists
[odo] I0409 14:46:21.192714   18863 occlient.go:571] Status of creation of service account &ServiceAccount{ObjectMeta:k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta{Name:default,GenerateName:,Namespace:fgqbtmujjt,SelfLink:/api/v1/namespaces/fgqbtmujjt/serviceaccounts/default,UID:c6364f68-7a42-11ea-875c-52fdfc072182,ResourceVersion:993551,Generation:0,CreationTimestamp:2020-04-09 14:46:20 +0530 IST,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,},Secrets:[{  default-token-pcw66    } {  default-dockercfg-mctts    }],ImagePullSecrets:[{default-dockercfg-mctts}],AutomountServiceAccountToken:nil,} is ready
 ✓  Waiting for project to come up [812ms]
[odo]  ✓  Project 'fgqbtmujjt' is ready for use
[odo]  ✓  New project created and now using project: fgqbtmujjt
[odo] I0409 14:46:21.207444   18863 odo.go:80] Could not get the latest release information in time. Never mind, exiting gracefully :)
Running odo with args [odo component create nodejs lfhyf --app zgpbk --project fgqbtmujjt --context /tmp/234650130]
[odo]  •  Validating component  ...
 ✓  Validating component [7ms]
[odo] 
[odo] Please use `odo push` command to create the component with source deployed
Running odo with args [odo url create example-1 --context /tmp/234650130]
[odo]  ✓  URL example-1 created for component: lfhyf
[odo] 
[odo] To create URL on the OpenShift Cluster, please use `odo push`
Running odo with args [odo storage create storage-1 --size 1Gi --path /data1 --context /tmp/234650130]
[odo]  ✓  Added storage storage-1 to lfhyf
[odo] 
[odo] Please use `odo push` command to make the storage accessible to the component
Running odo with args [odo component push --context /tmp/234650130]
[odo] Validation
[odo]  •  Checking component  ...
 ✓  Checking component [11ms]
[odo] 
[odo] Configuration changes
[odo]  ✓  Added storage storage-1 to lfhyf
[odo]  ✓  Initializing component
[odo]  •  Creating component  ...
 ✓  Creating component [70ms]
[odo] 
[odo] Applying URL changes
[odo]  ✓  URL example-1: http://example-1-zgpbk-fgqbtmujjt.apps-crc.testing created
[odo] 
[odo] Pushing to component lfhyf of type local
[odo]  •  Checking files for pushing  ...
 ✓  Checking files for pushing [414035ns]
[odo]  •  Waiting for component to start  ...
 ✓  Waiting for component to start [20s]
[odo]  •  Syncing files to the component  ...
 ✓  Syncing files to the component [6s]
[odo]  •  Building component  ...
 ✓  Building component [7s]
[odo]  ✓  Changes successfully pushed to component
Running odo with args [odo url create example-2 --context /tmp/234650130]
[odo]  ✓  URL example-2 created for component: lfhyf
[odo] 
[odo] To create URL on the OpenShift Cluster, please use `odo push`
Running odo with args [odo storage create storage-2 --size 1Gi --path /data2 --context /tmp/234650130]
[odo]  ✓  Added storage storage-2 to lfhyf
[odo] 
[odo] Please use `odo push` command to make the storage accessible to the component
Running odo with args [odo component push --context /tmp/234650130]
[odo] Validation
[odo]  •  Checking component  ...
 ✓  Checking component [23ms]
[odo] 
[odo] Configuration changes
[odo]  •  Retrieving component data  ...
[odo]  ✓  Added storage storage-2 to lfhyf
 ✓  Retrieving component data [37ms]
[odo]  •  Applying configuration  ...
 ✓  Applying configuration [35s]
[odo] 
[odo] Applying URL changes
[odo]  ✓  URL example-1 already exists
[odo]  ✓  URL example-2: http://example-2-zgpbk-fgqbtmujjt.apps-crc.testing created
[odo] 
[odo] Pushing to component lfhyf of type local
[odo]  •  Checking file changes for pushing  ...
 ✓  Checking file changes for pushing [169169ns]
[odo]  ✓  No file changes detected, skipping build. Use the '-f' flag to force the build.
Running odo with args [odo component delete -f --context /tmp/234650130]
[odo] This component has following urls that will be deleted with component
[odo] URL named example-1 with host example-1-zgpbk-fgqbtmujjt.apps-crc.testing having protocol http at port 8080
[odo] URL named example-2 with host example-2-zgpbk-fgqbtmujjt.apps-crc.testing having protocol http at port 8080
[odo] This component has following storages which will be deleted with the component
[odo] Storage storage-1 of size 1Gi
[odo] Storage storage-2 of size 1Gi
[odo]  •  Deleting component lfhyf  ...
 ✓  Deleting component lfhyf [220ms]
[odo]  ✓  Component lfhyf from application zgpbk has been deleted
Running oc with args [oc get routes --namespace fgqbtmujjt]
[oc] NAME              HOST/PORT                                     PATH   SERVICES      PORT   TERMINATION   WILDCARD
[oc] example-1-zgpbk   example-1-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
[oc] example-2-zgpbk   example-2-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None

NAME              HOST/PORT                                     PATH   SERVICES      PORT   TERMINATION   WILDCARD
example-1-zgpbk   example-1-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
example-2-zgpbk   example-2-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
Deleting project: fgqbtmujjt
Running odo with args [odo project delete fgqbtmujjt -f]
[odo]  •  Deleting project fgqbtmujjt  ...
 ✓  Deleting project fgqbtmujjt [28s]
[odo]  ✓  Deleted project : fgqbtmujjt
Deleting dir: /tmp/234650130

• Failure [99.383 seconds]
odo sub component command tests
/home/adisky/go/src/github.com/openshift/odo/tests/integration/cmd_cmp_sub_test.go:13
  odo component delete should clean owned resources
  /home/adisky/go/src/github.com/openshift/odo/tests/integration/component.go:823
    should delete the component and the owned resources with wait flag [It]
    /home/adisky/go/src/github.com/openshift/odo/tests/integration/component.go:858

    Expected
        <string>: NAME              HOST/PORT                                     PATH   SERVICES      PORT   TERMINATION   WILDCARD
        example-1-zgpbk   example-1-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
        example-2-zgpbk   example-2-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
        
    not to contain substring
        <string>: example

    /home/adisky/go/src/github.com/openshift/odo/tests/helper/helper_oc.go:491
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Summarizing 2 Failures:

[Fail] odo component command tests odo component delete should clean owned resources [It] should delete the component and the owned resources with wait flag 
/home/adisky/go/src/github.com/openshift/odo/tests/helper/helper_oc.go:491

[Fail] odo sub component command tests odo component delete should clean owned resources [It] should delete the component and the owned resources with wait flag 
/home/adisky/go/src/github.com/openshift/odo/tests/helper/helper_oc.go:491

Ran 2 of 170 Specs in 223.129 seconds
FAIL! -- 0 Passed | 2 Failed | 0 Pending | 168 Skipped
--- FAIL: TestIntegration (223.13s)
FAIL

Ginkgo ran 1 suite in 3m44.768249387s
Test Suite Failed

@amitkrout
Copy link
Contributor

@amitkrout raw test logs, in case resource exist, test should fail.

odo sub component command tests odo component delete should clean owned resources 
  should delete the component and the owned resources with wait flag
  /home/adisky/go/src/github.com/openshift/odo/tests/integration/component.go:858
Created dir: /tmp/234650130
Creating a new project: fgqbtmujjt
Running odo with args [odo project create fgqbtmujjt -w -v4]
[odo] I0409 14:46:20.352890   18863 preference.go:165] The path for preference file is /tmp/234650130/config.yaml
[odo]  •  Waiting for project to come up  ...
[odo] I0409 14:46:21.186053   18863 occlient.go:531] Status of creation of project fgqbtmujjt is Active
[odo] I0409 14:46:21.186128   18863 occlient.go:536] Project fgqbtmujjt now exists
[odo] I0409 14:46:21.192714   18863 occlient.go:571] Status of creation of service account &ServiceAccount{ObjectMeta:k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta{Name:default,GenerateName:,Namespace:fgqbtmujjt,SelfLink:/api/v1/namespaces/fgqbtmujjt/serviceaccounts/default,UID:c6364f68-7a42-11ea-875c-52fdfc072182,ResourceVersion:993551,Generation:0,CreationTimestamp:2020-04-09 14:46:20 +0530 IST,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,},Secrets:[{  default-token-pcw66    } {  default-dockercfg-mctts    }],ImagePullSecrets:[{default-dockercfg-mctts}],AutomountServiceAccountToken:nil,} is ready
 ✓  Waiting for project to come up [812ms]
[odo]  ✓  Project 'fgqbtmujjt' is ready for use
[odo]  ✓  New project created and now using project: fgqbtmujjt
[odo] I0409 14:46:21.207444   18863 odo.go:80] Could not get the latest release information in time. Never mind, exiting gracefully :)
Running odo with args [odo component create nodejs lfhyf --app zgpbk --project fgqbtmujjt --context /tmp/234650130]
[odo]  •  Validating component  ...
 ✓  Validating component [7ms]
[odo] 
[odo] Please use `odo push` command to create the component with source deployed
Running odo with args [odo url create example-1 --context /tmp/234650130]
[odo]  ✓  URL example-1 created for component: lfhyf
[odo] 
[odo] To create URL on the OpenShift Cluster, please use `odo push`
Running odo with args [odo storage create storage-1 --size 1Gi --path /data1 --context /tmp/234650130]
[odo]  ✓  Added storage storage-1 to lfhyf
[odo] 
[odo] Please use `odo push` command to make the storage accessible to the component
Running odo with args [odo component push --context /tmp/234650130]
[odo] Validation
[odo]  •  Checking component  ...
 ✓  Checking component [11ms]
[odo] 
[odo] Configuration changes
[odo]  ✓  Added storage storage-1 to lfhyf
[odo]  ✓  Initializing component
[odo]  •  Creating component  ...
 ✓  Creating component [70ms]
[odo] 
[odo] Applying URL changes
[odo]  ✓  URL example-1: http://example-1-zgpbk-fgqbtmujjt.apps-crc.testing created
[odo] 
[odo] Pushing to component lfhyf of type local
[odo]  •  Checking files for pushing  ...
 ✓  Checking files for pushing [414035ns]
[odo]  •  Waiting for component to start  ...
 ✓  Waiting for component to start [20s]
[odo]  •  Syncing files to the component  ...
 ✓  Syncing files to the component [6s]
[odo]  •  Building component  ...
 ✓  Building component [7s]
[odo]  ✓  Changes successfully pushed to component
Running odo with args [odo url create example-2 --context /tmp/234650130]
[odo]  ✓  URL example-2 created for component: lfhyf
[odo] 
[odo] To create URL on the OpenShift Cluster, please use `odo push`
Running odo with args [odo storage create storage-2 --size 1Gi --path /data2 --context /tmp/234650130]
[odo]  ✓  Added storage storage-2 to lfhyf
[odo] 
[odo] Please use `odo push` command to make the storage accessible to the component
Running odo with args [odo component push --context /tmp/234650130]
[odo] Validation
[odo]  •  Checking component  ...
 ✓  Checking component [23ms]
[odo] 
[odo] Configuration changes
[odo]  •  Retrieving component data  ...
[odo]  ✓  Added storage storage-2 to lfhyf
 ✓  Retrieving component data [37ms]
[odo]  •  Applying configuration  ...
 ✓  Applying configuration [35s]
[odo] 
[odo] Applying URL changes
[odo]  ✓  URL example-1 already exists
[odo]  ✓  URL example-2: http://example-2-zgpbk-fgqbtmujjt.apps-crc.testing created
[odo] 
[odo] Pushing to component lfhyf of type local
[odo]  •  Checking file changes for pushing  ...
 ✓  Checking file changes for pushing [169169ns]
[odo]  ✓  No file changes detected, skipping build. Use the '-f' flag to force the build.
Running odo with args [odo component delete -f --context /tmp/234650130]
[odo] This component has following urls that will be deleted with component
[odo] URL named example-1 with host example-1-zgpbk-fgqbtmujjt.apps-crc.testing having protocol http at port 8080
[odo] URL named example-2 with host example-2-zgpbk-fgqbtmujjt.apps-crc.testing having protocol http at port 8080
[odo] This component has following storages which will be deleted with the component
[odo] Storage storage-1 of size 1Gi
[odo] Storage storage-2 of size 1Gi
[odo]  •  Deleting component lfhyf  ...
 ✓  Deleting component lfhyf [220ms]
[odo]  ✓  Component lfhyf from application zgpbk has been deleted
Running oc with args [oc get routes --namespace fgqbtmujjt]
[oc] NAME              HOST/PORT                                     PATH   SERVICES      PORT   TERMINATION   WILDCARD
[oc] example-1-zgpbk   example-1-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
[oc] example-2-zgpbk   example-2-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None

NAME              HOST/PORT                                     PATH   SERVICES      PORT   TERMINATION   WILDCARD
example-1-zgpbk   example-1-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
example-2-zgpbk   example-2-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
Deleting project: fgqbtmujjt
Running odo with args [odo project delete fgqbtmujjt -f]
[odo]  •  Deleting project fgqbtmujjt  ...
 ✓  Deleting project fgqbtmujjt [28s]
[odo]  ✓  Deleted project : fgqbtmujjt
Deleting dir: /tmp/234650130

• Failure [99.383 seconds]
odo sub component command tests
/home/adisky/go/src/github.com/openshift/odo/tests/integration/cmd_cmp_sub_test.go:13
  odo component delete should clean owned resources
  /home/adisky/go/src/github.com/openshift/odo/tests/integration/component.go:823
    should delete the component and the owned resources with wait flag [It]
    /home/adisky/go/src/github.com/openshift/odo/tests/integration/component.go:858

    Expected
        <string>: NAME              HOST/PORT                                     PATH   SERVICES      PORT   TERMINATION   WILDCARD
        example-1-zgpbk   example-1-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
        example-2-zgpbk   example-2-zgpbk-fgqbtmujjt.apps-crc.testing          lfhyf-zgpbk   8080                 None
        
    not to contain substring
        <string>: example

    /home/adisky/go/src/github.com/openshift/odo/tests/helper/helper_oc.go:491
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Summarizing 2 Failures:

[Fail] odo component command tests odo component delete should clean owned resources [It] should delete the component and the owned resources with wait flag 
/home/adisky/go/src/github.com/openshift/odo/tests/helper/helper_oc.go:491

[Fail] odo sub component command tests odo component delete should clean owned resources [It] should delete the component and the owned resources with wait flag 
/home/adisky/go/src/github.com/openshift/odo/tests/helper/helper_oc.go:491

Ran 2 of 170 Specs in 223.129 seconds
FAIL! -- 0 Passed | 2 Failed | 0 Pending | 168 Skipped
--- FAIL: TestIntegration (223.13s)
FAIL

Ginkgo ran 1 suite in 3m44.768249387s
Test Suite Failed

Thnaks @adisky for discussing it over BJN. As a discussion outcome what i found that, the validation is done for the storage sub string which is printed in StdOut (In this case it's "" because resource deleted successfully) and ofcourse as you metioned in the call we should not bother about the StdErr message, i agree.

Thanks @adisky for the clarification

Test looks good to me.

Approvers can you please have a look @girishramnani @kadel @cdrage

@adisky
Copy link
Contributor Author

adisky commented Apr 9, 2020

@amitkrout Thanks for the discussion and your inputs :)

@mik-dass
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 13, 2020
defer watcher.Stop()
eventCh := watcher.ResultChan()

for {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that all the case statements in the select are terminating which means we might not need the for loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes even i thought so, and removed the for loop but it did not work, since we get events on eventCh other than error deleted, case events gets selected and executes none of the if conditions, returns from the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, maybe an idea would be to just v4 log those events for debugging purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, sure will update for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe lets do that in a follow up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a follow up #2879

@girishramnani
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: girishramnani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Apr 14, 2020
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 700a8fd into redhat-developer:master Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odo delete should wait until all component related resources are gone before exit
7 participants