-
Notifications
You must be signed in to change notification settings - Fork 382
Conversation
test/e2e/walkthrough.go
Outdated
var ( | ||
brokerName = upsbrokername | ||
serviceclassName = "user-provided-service" | ||
serviceplanName = coreutil.ConstructPlanName("default", "86064792-7ea2-467b-af93-ac9694d96d52") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
I think this is actually obsolete now - correct me if I'm wrong. |
@pmorie This does not look obsolete to me. I see no check for plans in the current walkthrough as it exists. I will rebase. |
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? |
It seems like the test wants to make sure plans are actually written down, and not necessarily to make the test more deterministic? |
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? |
test/e2e/walkthrough.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. 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. |
@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. |
@staebler makes sense. It sounds like instead of adding this wait, I should be taking out the existing waits on classes and brokers. |
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" |
test/util/util.go
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClusterServicePlan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, thanks
@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. |
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.