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

Add odo push to link/unlink tests #3837

Merged
merged 1 commit into from
Aug 28, 2020
Merged

Add odo push to link/unlink tests #3837

merged 1 commit into from
Aug 28, 2020

Conversation

dharmit
Copy link
Member

@dharmit dharmit commented Aug 26, 2020

What type of PR is this?
I don't know. It's pretty sure not a bug! This PR is mainly opened to fix something that's working just fine on developer/QE systems but failing in CI.

What does does this PR do / why we need it:
This is being done for two reasons:

  1. CI is likely slow to link/unlink as observed in
    Consecutive service link/unlink doesn't work properly on CI #3834
  2. link/unlink require "odo push" for underlying deployment

Which issue(s) this PR fixes:

Fixes #3834

PR acceptance criteria:

How to test changes / Special notes to the reviewer:

This is being done for two reasons:
1) CI is likely slow to link/unlink as observed in
   #3834
2) link/unlink require "odo push" for underlying deployment
@@ -433,11 +433,13 @@ spec:

stdOut := helper.CmdShouldPass("odo", "link", "EtcdCluster/example")
Expect(stdOut).To(ContainSubstring("Successfully created link between component"))
helper.CmdShouldPass("odo", "push")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right. But adding odo push at the place where you're suggesting it would be just a hack to make sure that we introduce some timeout between the two calls. Adding it where I have proposed in the PR right now makes sure that we're following the flow that a user would when using odo link/odo unlink commands and it still gives us the timeout we need to avoid the race condition from arising.

Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I don't understand why we are bandaging it with odo push when its not necessary. I would say lets not complicate the test scenario, consider a simple example:

> odo link EtcdCluster/example
			
> odo unlink EtcdCluster/example

> odo link EtcdCluster/example  //This is failing

> odo push

Maybe your current changes will hide the issue but it won't fix the real issue. In future I am pretty sure somebody will hit the issue with the same scenario. Also frankly speaking as a end user I won't rely much on .odo/env/env.yaml for services state failure.

@@ -433,11 +433,13 @@ spec:

stdOut := helper.CmdShouldPass("odo", "link", "EtcdCluster/example")
Expect(stdOut).To(ContainSubstring("Successfully created link between component"))
helper.CmdShouldPass("odo", "push")
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I don't understand why we are bandaging it with odo push when its not necessary. I would say lets not complicate the test scenario, consider a simple example:

> odo link EtcdCluster/example
			
> odo unlink EtcdCluster/example

> odo link EtcdCluster/example  //This is failing

> odo push

Maybe your current changes will hide the issue but it won't fix the real issue. In future I am pretty sure somebody will hit the issue with the same scenario. Also frankly speaking as a end user I won't rely much on .odo/env/env.yaml for services state failure.

@dharmit
Copy link
Member Author

dharmit commented Aug 26, 2020

@prietyc123

TBH I don't understand why we are bandaging it with odo push when its not necessary.

I already explained why we're adding this in #3834 (comment).

Maybe your current changes will hide the issue but it won't fix the real issue.

The real issue has been pointed to by @amitkrout in #3834 (comment). It's a race condition showing up on CI. Maybe you can fix that and I'll close this PR in that case.

Also frankly speaking as a end user I won't rely much on .odo/env/env.yaml for services state failure.

We're relying on this file for information about the link. Not for the state of the service.

@dharmit
Copy link
Member Author

dharmit commented Aug 26, 2020

Don't really understand why oc get csv would fail. Maybe a flake?
/test v4.5-integration-e2e

++ oc adm policy add-role-to-user edit developer
Warning: User 'developer' not found
clusterrole.rbac.authorization.k8s.io/edit added: "developer"
++ sh ./scripts/setup-operators.sh
+ CI_OPERATOR_HUB_PROJECT=ci-operator-hub-project
+ count=0
+ '[' 0 -lt 5 ']'
+ oc get csv -n openshift-operators
+ grep mongo
I0826 10:01:42.215739      87 request.go:621] Throttling request took 1.134171471s, request: GET:https://api.ci-op-17f0tnww-2f74e.origin-ci-int-aws.dev.rhcloud.com:6443/apis/batch/v1?timeout=32s
error: the server doesn't have a resource type "csv"
+ install_mongo_operator
+ oc create -f - 

@amitkrout
Copy link
Contributor

The real issue has been pointed to by @amitkrout in #3834 (comment). It's a race condition showing up on CI. Maybe you can fix that and I'll close this PR in that case.

The race condition i want to describe here is

For command odo link EtcdCluster/example i have not much idea what process it runs behind the scene but as a user i would expect the next command odo unlink EtcdCluster/example should not fail due to some pending status of the previous command. May be when link or unlink command complete but it still wait some process to complete under the hood.

@prietyc123 Last time i was using the the complete spec, instead you can scope out few things from there and focus the failure steps. For example you can please try these simple scenario locally.

odo unlink EtcdCluster/example
odo link EtcdCluster/example
odo link EtcdCluster/example

@dharmit
Copy link
Member Author

dharmit commented Aug 27, 2020

For command odo link EtcdCluster/example i have not much idea what process it runs behind the scene

It creates a Service Bbinding Request. "Service Binding Request" (SBR) is an API provided by Service Binding Operator (SBO). Due to certain limitations, we had to introduce odo push as a part of the workflow for the linking to take place well. More info can be found in #2920.

May be when link or unlink command complete but it still wait some process to complete under the hood.

On the cluster side, link/unlink are incomplete unless odo push was executed. When working with Operator Hub, odo makes sure that there's clear messaging about requirement to do odo push:

$ odo link EtcdCluster/example
 ✓  Successfully created link between component "node-todo" and service "EtcdCluster/example"

To apply the link, please use `odo push`

$ odo unlink EtcdCluster/example                                                                                                                                                              
 ✓  Successfully unlinked component "node-todo" from service "EtcdCluster/example"                                                                                                            
                                                                                                                                                                                              
To apply the changes, please use `odo push`

@amitkrout
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amitkrout

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 Aug 27, 2020
@prietyc123
Copy link
Contributor

Thanks for detailed information. Looks good to me.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Aug 27, 2020
@openshift-bot
Copy link

/retest

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

1 similar comment
@openshift-bot
Copy link

/retest

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

@codecov
Copy link

codecov bot commented Aug 27, 2020

Codecov Report

Merging #3837 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3837   +/-   ##
=======================================
  Coverage   44.22%   44.22%           
=======================================
  Files         139      139           
  Lines       13420    13420           
=======================================
  Hits         5935     5935           
  Misses       6903     6903           
  Partials      582      582           

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 552aad7...2323ab4. Read the comment docs.

@girishramnani
Copy link
Contributor

/retest

@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 de77f8b into redhat-developer:master Aug 28, 2020
@dharmit dharmit deleted the fix-3834 branch April 18, 2022 08:45
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. 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.

Consecutive service link/unlink doesn't work properly on CI
7 participants