Skip to content

Commit

Permalink
ibmcloud: Included missing code changes
Browse files Browse the repository at this point in the history
Added excluded code snippets while rebasing the PR #1502. Enhanced Debugging for Readiness Probe Status in Nightly Jenkins Run

Fixes: #1450

Signed-off-by: Sudharshan Muralidharan <sudharshan.muralidharan@ibm.com>
  • Loading branch information
sudharshanibm3 authored and liudali committed Nov 8, 2023
1 parent b70c954 commit af7ac21
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions test/e2e/assessment_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (tc *testCase) run() {
if err = wait.For(conditions.New(client.Resources()).PodPhaseMatch(tc.pod, tc.podState), wait.WithTimeout(WAIT_POD_RUNNING_TIMEOUT)); err != nil {
t.Fatal(err)
}
if tc.podState == v1.PodRunning {
if tc.podState == v1.PodRunning || tc.pod.Spec.Containers[0].ReadinessProbe != nil {
clientset, err := kubernetes.NewForConfig(client.RESTConfig())
if err != nil {
t.Fatal(err)
Expand All @@ -198,11 +198,37 @@ func (tc *testCase) run() {
if err != nil {
t.Fatal(err)
}
//Included logs for debugging nightly tests
//Added logs for debugging nightly tests
t.Logf("Expected Pod State: %v", tc.podState)
t.Logf("Current Pod State: %v", pod.Status.Phase)
}
//Getting Readiness probe of a container
for i, condition := range pod.Status.Conditions {
fmt.Printf("===================\n")
fmt.Printf("Checking Conditons - %v....\n", i+1)
fmt.Printf("===================\n")
fmt.Printf("*.Condition Type: %v\n", condition.Type)
fmt.Printf("*.Condition Status: %v\n", condition.Status)
fmt.Printf("*.Condition Last Probe Time: %v\n", condition.LastProbeTime)
fmt.Printf("*.Condition Last Transition Time: %v\n", condition.LastTransitionTime)
fmt.Printf("*.Condition Last Message: %v\n", condition.Message)
fmt.Printf("*.Condition Last Reason: %v\n", condition.Reason)
}

readinessProbe := pod.Spec.Containers[0].ReadinessProbe
if readinessProbe != nil {
fmt.Printf("===================\n")
fmt.Printf("Checking Readiness Probe....\n")
fmt.Printf("===================\n")
fmt.Printf("*.Initial Delay Seconds: %v\n", readinessProbe.InitialDelaySeconds)
fmt.Printf("*.Timeout Seconds: %v\n", readinessProbe.TimeoutSeconds)
fmt.Printf("*.Success Threshold: %v\n", readinessProbe.SuccessThreshold)
fmt.Printf("*.Failure Threshold: %v\n", readinessProbe.FailureThreshold)
fmt.Printf("*.Period Seconds: %v\n", readinessProbe.PeriodSeconds)
fmt.Printf("*.Probe Handler: %v\n", readinessProbe.ProbeHandler)
fmt.Printf("*.Probe Handler Port: %v\n", readinessProbe.ProbeHandler.HTTPGet.Port)
fmt.Printf("===================\n")
}
}
}

return ctx
Expand Down

0 comments on commit af7ac21

Please sign in to comment.