k3s/pkg/kubelet
Kubernetes Submit Queue b265f7c682
Merge pull request #65582 from dtaniwaki/fix-test-failure-of-truncated-time
Automatic merge from submit-queue (batch tested with PRs 65582, 65480, 65310, 65644, 65645). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix test failure of truncated time

**What this PR does / why we need it**:

The test of `TestFsStoreAssignedModified` in `pkg/kubelet/kubeletconfig/checkpoint/store` fails in my environment like below.

```
$ make test WHAT=./pkg/kubelet/kubeletconfig/checkpoint/store/
Running tests for APIVersion: v1,admissionregistration.k8s.io/v1alpha1,admissionregistration.k8s.io/v1beta1,admission.k8s.io/v1beta1,apps/v1beta1,apps/v1beta2,apps/v1,authentication.k8s.io/v1,authentication.k8s.io/v1beta1,authorization.k8s.io/v1,authorization.k8s.io/v1beta1,autoscaling/v1,autoscaling/v2beta1,batch/v1,batch/v1beta1,batch/v2alpha1,certificates.k8s.io/v1beta1,coordination.k8s.io/v1beta1,extensions/v1beta1,events.k8s.io/v1beta1,imagepolicy.k8s.io/v1alpha1,networking.k8s.io/v1,policy/v1beta1,rbac.authorization.k8s.io/v1,rbac.authorization.k8s.io/v1beta1,rbac.authorization.k8s.io/v1alpha1,scheduling.k8s.io/v1alpha1,scheduling.k8s.io/v1beta1,settings.k8s.io/v1alpha1,storage.k8s.io/v1beta1,storage.k8s.io/v1,storage.k8s.io/v1alpha1,
+++ [0628 22:53:39] Running tests without code coverage
--- FAIL: TestFsStoreAssignedModified (0.00s)
        fsstore_test.go:316: expect "2018-06-28T22:53:43+09:00" but got "2018-06-28T22:53:43+09:00"
FAIL
FAIL    k8s.io/kubernetes/pkg/kubelet/kubeletconfig/checkpoint/store    0.236s
make: *** [test] Error 1
```

My environment is
OS: macOS Sierra Version 10.12.6
File System: Journaled HFS+

The error message confused me because the comparing times looked the same in the error log. If we know certain systems truncate times, I think we can just compare less precise times to avoid confusions in tests.

**Special notes for your reviewer**:
N/A

**Release note**:

```release-note
NONE
```
2018-06-29 20:14:06 -07:00
..
apis fix wrong output messages about EnforceNodeAllocatable 2018-06-27 15:31:32 +08:00
cadvisor Cleanup verbose cAdvisor mocking in Kubelet unit tests 2018-06-27 11:53:41 -07:00
certificate Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
checkpoint Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
checkpointmanager Make 'pod' package to use unified checkpointManager 2018-04-16 01:30:20 -04:00
client Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
cm feature gate LSI capacity calculation 2018-06-28 14:01:08 -05:00
config Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
configmap Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
container Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
custommetrics Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
dockershim Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
envvars Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
events
eviction Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
images Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
kubeletconfig Fix test failure of truncated time 2018-06-30 01:14:44 +09:00
kuberuntime Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
leaky
lifecycle Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
logs Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
metrics Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
mountpod Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
network Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
pleg Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
pod Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
preemption Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
prober Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
qos Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
remote Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
secret Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
server Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
stats Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
status Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
sysctl Run make update 2018-06-06 00:12:40 +02:00
token Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
types Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
util Add hierarchy support for plugin directory 2018-06-25 17:32:18 -07:00
volumemanager Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
winstats Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
BUILD Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
OWNERS
active_deadline.go
active_deadline_test.go
doc.go
kubelet.go Revert "certs: only append locally discovered addresses when we got none from the cloudprovider" 2018-06-28 12:36:24 -04:00
kubelet_getters.go Apply pod name and namespace labels for pod cgroup for cadvisor metrics 2018-05-07 14:51:12 -04:00
kubelet_getters_test.go
kubelet_network.go Move hairpin mode logic to dockershim 2018-04-11 09:21:17 -07:00
kubelet_network_test.go Move the kubelet network package down to dockershim 2018-04-11 09:25:56 -07:00
kubelet_node_status.go Merge pull request #64491 from hzxuzhonghu/kubelet-node-schedule-event-record 2018-06-20 23:02:52 -07:00
kubelet_node_status_test.go Cleanup verbose cAdvisor mocking in Kubelet unit tests 2018-06-27 11:53:41 -07:00
kubelet_pods.go Inject ContainersReady 2018-06-05 11:10:38 -07:00
kubelet_pods_test.go Merge pull request #64006 from Random-Liu/streaming-auth 2018-05-31 22:45:29 -07:00
kubelet_pods_windows_test.go Add dynamic environment variable substitution to subpaths 2018-05-29 17:01:09 +01:00
kubelet_resources.go
kubelet_resources_test.go Cleanup verbose cAdvisor mocking in Kubelet unit tests 2018-06-27 11:53:41 -07:00
kubelet_test.go Cleanup verbose cAdvisor mocking in Kubelet unit tests 2018-06-27 11:53:41 -07:00
kubelet_volumes.go
kubelet_volumes_test.go Refactor of GenerateMapDeviceFunc to delegate Map call to volume plugin. 2018-06-03 17:25:37 -04:00
oom_watcher.go
oom_watcher_test.go
pod_container_deletor.go kubelet: force filterContainerID to empty string when removeAll is true 2018-04-30 16:29:17 -05:00
pod_container_deletor_test.go
pod_workers.go
pod_workers_test.go
reason_cache.go
reason_cache_test.go
runonce.go
runonce_test.go implement service account token projection 2018-06-04 17:22:08 -07:00
runtime.go cleanup some dead kubelet code 2018-05-29 22:38:01 +08:00
util.go
volume_host.go implement service account token projection 2018-06-04 17:22:08 -07:00