Skip to content

Commit

Permalink
Show job logs before assertion
Browse files Browse the repository at this point in the history
otherwise they'd not be shown in case of failure
  • Loading branch information
hash-d committed Nov 21, 2024
1 parent 51bb6b2 commit e7f95e3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/integration/examples/tcp_echo/tcp_echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,17 @@ func runTests(t *testing.T, r base.ClusterTestRunner, svc types.ServiceInterface
endTime = time.Now().Add(constants.ImagePullingAndResourceCreationTimeout)

job, err := k8s.WaitForJob(pub1Cluster.Namespace, pub1Cluster.VanClient.KubeClient, jobName, endTime.Sub(time.Now()))
if err != nil {
pub1Cluster.KubectlExec("logs job/" + jobName)
}
assert.Assert(t, err)
pub1Cluster.KubectlExec("logs job/" + jobName)
k8s.AssertJob(t, job)

job, err = k8s.WaitForJob(prv1Cluster.Namespace, prv1Cluster.VanClient.KubeClient, jobName, endTime.Sub(time.Now()))
if err != nil {
prv1Cluster.KubectlExec("logs job/" + jobName)
}
assert.Assert(t, err)
prv1Cluster.KubectlExec("logs job/" + jobName)
k8s.AssertJob(t, job)

netcatJobName := fmt.Sprintf("netcat-%s", svc.Address)
Expand Down

0 comments on commit e7f95e3

Please sign in to comment.