From 0c80a7aa40672cb20c22a28f0a5c5465184f13ed Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Thu, 27 Apr 2017 09:58:00 -0700 Subject: [PATCH] fix go vet's from skipped tests --- test/integration/client/client_test.go | 2 +- test/integration/evictions/evictions_test.go | 2 +- test/integration/scheduler/extender_test.go | 12 +++++++++--- test/integration/scheduler/scheduler_test.go | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/test/integration/client/client_test.go b/test/integration/client/client_test.go index cef5c330a7..78c7be698f 100644 --- a/test/integration/client/client_test.go +++ b/test/integration/client/client_test.go @@ -561,7 +561,7 @@ func TestSingleWatch(t *testing.T) { func TestMultiWatch(t *testing.T) { // Disable this test as long as it demonstrates a problem. // TODO: Reenable this test when we get #6059 resolved. - return + t.Skip() const watcherCount = 50 rt.GOMAXPROCS(watcherCount) diff --git a/test/integration/evictions/evictions_test.go b/test/integration/evictions/evictions_test.go index 042227f59e..f26d5edb9c 100644 --- a/test/integration/evictions/evictions_test.go +++ b/test/integration/evictions/evictions_test.go @@ -161,7 +161,7 @@ func TestConcurrentEvictionRequests(t *testing.T) { } if atomic.LoadUint32(&numberPodsEvicted) != numOfEvictions { - t.Fatalf("fewer number of successful evictions than expected :", numberPodsEvicted) + t.Fatalf("fewer number of successful evictions than expected : %d", numberPodsEvicted) } } diff --git a/test/integration/scheduler/extender_test.go b/test/integration/scheduler/extender_test.go index 7fe9f263e2..20895c5ff9 100644 --- a/test/integration/scheduler/extender_test.go +++ b/test/integration/scheduler/extender_test.go @@ -230,7 +230,10 @@ func machine_2_Prioritizer(pod *v1.Pod, nodes *v1.NodeList) (*schedulerapi.HostP if node.Name == "machine2" { score = 10 } - result = append(result, schedulerapi.HostPriority{node.Name, score}) + result = append(result, schedulerapi.HostPriority{ + Host: node.Name, + Score: score, + }) } return &result, nil } @@ -242,7 +245,10 @@ func machine_3_Prioritizer(pod *v1.Pod, nodes *v1.NodeList) (*schedulerapi.HostP if node.Name == "machine3" { score = 10 } - result = append(result, schedulerapi.HostPriority{node.Name, score}) + result = append(result, schedulerapi.HostPriority{ + Host: node.Name, + Score: score, + }) } return &result, nil } @@ -353,7 +359,7 @@ func DoTestPodScheduling(ns *v1.Namespace, t *testing.T, cs clientset.Interface) Type: v1.NodeReady, Status: v1.ConditionTrue, Reason: fmt.Sprintf("schedulable condition"), - LastHeartbeatTime: metav1.Time{time.Now()}, + LastHeartbeatTime: metav1.Time{Time: time.Now()}, } node := &v1.Node{ Spec: v1.NodeSpec{Unschedulable: false}, diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go index 9ac06763ea..a2f575860a 100644 --- a/test/integration/scheduler/scheduler_test.go +++ b/test/integration/scheduler/scheduler_test.go @@ -323,13 +323,13 @@ func DoTestUnschedulableNodes(t *testing.T, cs clientset.Interface, ns *v1.Names Type: v1.NodeReady, Status: v1.ConditionTrue, Reason: fmt.Sprintf("schedulable condition"), - LastHeartbeatTime: metav1.Time{time.Now()}, + LastHeartbeatTime: metav1.Time{Time: time.Now()}, } badCondition := v1.NodeCondition{ Type: v1.NodeReady, Status: v1.ConditionUnknown, Reason: fmt.Sprintf("unschedulable condition"), - LastHeartbeatTime: metav1.Time{time.Now()}, + LastHeartbeatTime: metav1.Time{Time: time.Now()}, } // Create a new schedulable node, since we're first going to apply // the unschedulable condition and verify that pods aren't scheduled.