Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

e2e explicit plan check #1261

Merged
merged 4 commits into from
Apr 4, 2018
Merged

e2e explicit plan check #1261

merged 4 commits into from
Apr 4, 2018

Conversation

MHBauer
Copy link
Contributor

@MHBauer MHBauer commented Sep 22, 2017

This PR is not outdated or obsolete. WaitForClusterServicePlanToExist was implemented a second time in the period between now and submission, but it was never used in the e2e tests.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 22, 2017
var (
brokerName = upsbrokername
serviceclassName = "user-provided-service"
serviceplanName = coreutil.ConstructPlanName("default", "86064792-7ea2-467b-af93-ac9694d96d52")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a dependency on the content of the ups-broker binary?

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, it's hardcoded in the UPS.

@pmorie
Copy link
Contributor

pmorie commented Oct 3, 2017

I think this is actually obsolete now - correct me if I'm wrong.

@MHBauer
Copy link
Contributor Author

MHBauer commented Oct 19, 2017

@pmorie This does not look obsolete to me. I see no check for plans in the current walkthrough as it exists. I will rebase.

@MHBauer MHBauer added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 19, 2017
@staebler
Copy link
Contributor

Why do we want the e2e test to wait for the plan to exist prior to creating the instance? From the perspective of service catalog, it is perfectly acceptable to create the instance before the plan is created. Are we adding the wait to the e2e test to make the e2e test more deterministic?

@arschles
Copy link
Contributor

It seems like the test wants to make sure plans are actually written down, and not necessarily to make the test more deterministic?

@arschles arschles added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2017
@staebler
Copy link
Contributor

Fair enough. Is it worthwhile to check for both classes and all three plans, now that there are multiples of each? Or is it sufficient to verify that it is being done correctly for a single one of each?

@@ -113,6 +113,10 @@ var _ = framework.ServiceCatalogDescribe("walkthrough", func() {
err = util.WaitForClusterServiceClassToExist(f.ServiceCatalogClientSet.ServicecatalogV1beta1(), serviceclassID)
Expect(err).NotTo(HaveOccurred(), "failed to wait serviceclass to be ready")

By("Waiting for ClusterServicePlan to be ready")
err = util.WaitForClusterServicePlanToExist(f.ServiceCatalogClientSet.ServicecatalogV1beta1(), serviceplanID)
Expect(err).ShouldNot(HaveOccurred(), "serviceplan never became ready")
Copy link
Contributor

Choose a reason for hiding this comment

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

The Gomega documentation recommends NotTo instead of ShouldNot when using Expect. That would keep it consistent with the rest of the test as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Link to that recommendation? I was choosing the thing that 'read better' when I was looking at it. From what i could tell they were the exact same function.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MHBauer
Copy link
Contributor Author

MHBauer commented Nov 22, 2017

The order was not important beyond making sure all objects were fully there before moving on.

I'll have to go back when looking through the rebase. WaitForClusterServicePlanToExist seems to exist now, but I don't see it being used?

I would think we do need the plans to be extant before creating the instances. We could get rejected. If that is true, where does it stop? Why check for classes? or Brokers? Sounds like we could simplify the tests a whole lot if we don't need to check for anything.

I'll look into the multiples of classes and plans thing. The growth of the situation may mean more progress checking needs to be done.

@staebler
Copy link
Contributor

staebler commented Nov 22, 2017

I would think we do need the plans to be extant before creating the instances. We could get rejected. If that is true, where does it stop? Why check for classes? or Brokers? Sounds like we could simplify the tests a whole lot if we don't need to check for anything.

@MHBauer What do you mean by "[w]e could get rejected"? Are you suggesting that the API Server could reject the request to create the ServiceInstance? The API Server will only reject a request to create a ServiceInstance due to a missing ClusterServicePlan if the request does not explicitly specify a plan to use and instead requests that the default plan be chosen. That is not the case for this test. There is no need for the ClusterServicePlan, the ClusterServiceClass, or the ClusterServiceBroker to exist prior to making the request to create the ServiceInstance. Obviously, the Controller will not be able to reconcile the ServiceInstance until the ClusterServicePlan, ClusterServiceClass, and ClusterServiceBroker exist, but they can be created out of order.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 26, 2018
@MHBauer
Copy link
Contributor Author

MHBauer commented Mar 26, 2018

@staebler makes sense. It sounds like instead of adding this wait, I should be taking out the existing waits on classes and brokers.

@MHBauer MHBauer removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 26, 2018
@nilebox
Copy link
Contributor

nilebox commented Mar 26, 2018

Obviously, the Controller will not be able to reconcile the ServiceInstance until the ClusterServicePlan, ClusterServiceClass, and ClusterServiceBroker exist, but they can be created out of order.

I agree with that of course, but for the sake of ease of debugging failing tests, I would prefer to make sure that class and plan do exist and are healthy before creating an instance. That will help returning a "plan is broken" test failure message instead of "instance provisioning has timed out, something is wrong, go read the logs"

@jpeeler jpeeler added the LGTM1 label Mar 27, 2018
@@ -98,7 +98,7 @@ func WaitForClusterServiceClassToExist(client v1beta1servicecatalog.Servicecatal
)
}

// WaitForClusterServiceClassToExist waits for the ClusterServiceClass with the given name
// WaitForClusterServicePlanToExist waits for the ServicePlan with the given name
Copy link
Contributor

Choose a reason for hiding this comment

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

ClusterServicePlan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, thanks

@MHBauer
Copy link
Contributor Author

MHBauer commented Mar 29, 2018

@staebler in theory, I suppose I could start all the "wait for exists" in separate goroutines, and then wait for them all to finish and join before proceeding. I'd wait and move that to a future change to hit all the tests with the same pattern at the same time.

@jboyd01 jboyd01 added the LGTM2 label Apr 4, 2018
@jboyd01 jboyd01 merged commit 6409003 into kubernetes-retired:master Apr 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. LGTM1 LGTM2 size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants