diff --git a/pkg/controller/v1alpha2/trial/trial_controller.go b/pkg/controller/v1alpha2/trial/trial_controller.go index 1f5ffc99f67..b08fdf73186 100644 --- a/pkg/controller/v1alpha2/trial/trial_controller.go +++ b/pkg/controller/v1alpha2/trial/trial_controller.go @@ -228,7 +228,6 @@ func (r *ReconcileTrial) reconcileTrial(instance *trialsv1alpha2.Trial) error { } func (r *ReconcileTrial) reconcileJob(instance *trialsv1alpha2.Trial, desiredJob *unstructured.Unstructured) (*unstructured.Unstructured, error) { - var err error logger := log.WithValues("Trial", types.NamespacedName{Name: instance.GetName(), Namespace: instance.GetNamespace()}) apiVersion := desiredJob.GetAPIVersion() diff --git a/pkg/controller/v1alpha2/trial/trial_controller_test.go b/pkg/controller/v1alpha2/trial/trial_controller_test.go index 77ef21f5ff3..dea2549fd2b 100644 --- a/pkg/controller/v1alpha2/trial/trial_controller_test.go +++ b/pkg/controller/v1alpha2/trial/trial_controller_test.go @@ -164,7 +164,7 @@ func TestReconcileTFJobTrial(t *testing.T) { Should(gomega.MatchError("tfjobs.kubeflow.org \"test\" not found")) } -func TestReconcileComplectedTFJobTrial(t *testing.T) { +func TestReconcileCompletedTFJobTrial(t *testing.T) { g := gomega.NewGomegaWithT(t) instance := newFakeTrialWithTFJob() @@ -174,6 +174,9 @@ func TestReconcileComplectedTFJobTrial(t *testing.T) { mc := managerclientmock.NewMockManagerClient(mockCtrl) mc.EXPECT().CreateTrialInDB(gomock.Any()).Return(nil).AnyTimes() mc.EXPECT().UpdateTrialStatusInDB(gomock.Any()).Return(nil).AnyTimes() + mc.EXPECT().GetTrialObservationLog(gomock.Any()).Return(&api_pb.GetObservationLogReply{ + ObservationLog: nil, + }, nil).AnyTimes() // Setup the Manager and Controller. Wrap the Controller Reconcile function so it writes each request to a // channel when it is finished. @@ -215,6 +218,7 @@ func TestReconcileComplectedTFJobTrial(t *testing.T) { g.Expect(err).NotTo(gomega.HaveOccurred()) defer c.Delete(context.TODO(), instance) g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedRequest))) + g.Eventually(requests, timeout).Should(gomega.Receive(gomega.Equal(expectedRequest))) g.Eventually(func() error { return c.Get(context.TODO(), expectedRequest.NamespacedName, instance)