-
Notifications
You must be signed in to change notification settings - Fork 469
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 e2e test make sure resource quota error is surfaced #3087
base: master
Are you sure you want to change the base?
Add e2e test make sure resource quota error is surfaced #3087
Conversation
|
Another question, since each integration test creates its own namespace, is there a way to run the integration tests in parallel? I see we do |
@rueian would you mind reviewing this PR? |
g.Eventually(func() bool { | ||
rc, err := RayCluster(test, namespace.Name, rayCluster.Name)() | ||
if err != nil { | ||
return false | ||
} | ||
for _, condition := range rc.Status.Conditions { | ||
if condition.Type == "ReplicaFailure" && strings.Contains(condition.Message, "forbidden: exceeded quota") { | ||
return true | ||
} | ||
} | ||
return false | ||
}, TestTimeoutShort).Should(BeTrue(), "Expected ReplicaFailure condition with message containing 'forbidden: exceeded quota'") |
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.
Hi @han-steve,
Thank you for the new test!
g.Eventually(func() bool { | |
rc, err := RayCluster(test, namespace.Name, rayCluster.Name)() | |
if err != nil { | |
return false | |
} | |
for _, condition := range rc.Status.Conditions { | |
if condition.Type == "ReplicaFailure" && strings.Contains(condition.Message, "forbidden: exceeded quota") { | |
return true | |
} | |
} | |
return false | |
}, TestTimeoutShort).Should(BeTrue(), "Expected ReplicaFailure condition with message containing 'forbidden: exceeded quota'") | |
g.Eventually(RayCluster(test, namespace.Name, rayCluster.Name), TestTimeoutMedium). | |
Should(WithTransform(StatusCondition(rayv1.RayClusterReplicaFailure), MatchCondition(metav1.ConditionTrue, ...))) |
Could you also help us extend the existing MatchCondition
or add a new matcher that can match condition message?
I think it could be a good try but should be careful about resource control for the stability of the tests themselves. Log isolation for easy debugging might be another issue to be considered. |
Thanks for adding the new conditions to the RayCluster!
Small PR to add a quick integration test to make sure that we surface the resource quota error for better observability.