-
Notifications
You must be signed in to change notification settings - Fork 340
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
fix(tests): fixed flaky Readiness condition with never ready route test in e2e/common/traits/health_test.go #5503
Conversation
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.
LGTM. I wonder if the work in #5450 was not already good enough though. According to the Camel Jira issues, that was the way it had to be fixed.
according to this test run https://github.com/apache/camel-k/actions/runs/9065576954/job/24906613292?pr=5119 in particular:
something was still missing. |
Just for completeness, the parameters are controlling the behavior of the route controller in the case the a route would fail to start. In this case however, the route starts without errors and ad some point in the future it gets stopped which is outside of the control of the route controller (as the route was successfully started) hence, the route may result up if the health check is triggered before the control bus had a chance to actually stop the route. |
f533183
to
63d00f7
Compare
I simplified the route and test a little bit more to be sure that intent is clearer and the test dose not mislead the next poor soul who read it. In so doing I have also found that there were some minor issues (as conditions never actually evaluated) in the startup probe tests and I have tried to fix those as well. |
// TODO remove these workaround properties when https://issues.apache.org/jira/browse/CAMEL-20244 is fixed | ||
"-p", "camel.route-controller.unhealthyOnRestarting=true", | ||
"-p", "camel.route-controller.unhealthyOnExhausted=true", | ||
"-p", "camel.health.routesEnabled=false", |
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.
I think this is defeating the goal of the test. The idea is that the health is enabled on Camel side and we use those endpoints to query the route about it's health condition. I am not sure if I am understanding why this option is needed.
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.
That is there to avoid any possible (present or future) interaction and side effect between the custom check we define in files/NeverReady.java and the default checks. At the moment the test makes sense and would work both with and without that property, there are no routes declared in files/NeverReady.java anyway...
@@ -439,7 +437,7 @@ func TestHealthTrait(t *testing.T) { | |||
var r *v1.HealthCheckResponse | |||
|
|||
for h := range c.Pods[0].Health { | |||
if c.Pods[0].Health[h].Name == "camel-routes" && c.Pods[0].Health[h].Status == "DOWN" { | |||
if c.Pods[0].Health[h].Name == "never-ready" && c.Pods[0].Health[h].Status == "DOWN" { |
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.
This one look weird. If it is expected the Integration name, then, a randomized name variable name
should be provided instead. Are we sure this condition is really existing?
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.
We are sure because is the condition that we explicitly define in files/NeverReady.java
…st in e2e/common/traits/health_test.go
63d00f7
to
a833776
Compare
Due to how camel works stopping a route using the message bus inside the route can not assure that the route is reported always as stopped, there might be a small amount of time in which it can be reported as running.
Since the test is testing the behavior of camel k in the case that an integration is always reported not ready I took another approach by registering a custom healthcheck that force the reported condition to be never ready.
Release Note