Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7d4c85b0
Unverified
Commit
7d4c85b0
authored
Jun 30, 2018
by
Daisuke Taniwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test failure of truncated time
parent
c57cdc1d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
fsstore_test.go
pkg/kubelet/kubeletconfig/checkpoint/store/fsstore_test.go
+2
-3
No files found.
pkg/kubelet/kubeletconfig/checkpoint/store/fsstore_test.go
View file @
7d4c85b0
...
@@ -299,15 +299,14 @@ func TestFsStoreAssignedModified(t *testing.T) {
...
@@ -299,15 +299,14 @@ func TestFsStoreAssignedModified(t *testing.T) {
// create an empty assigned file, this is good enough for testing
// create an empty assigned file, this is good enough for testing
saveTestSourceFile
(
t
,
store
,
assignedFile
,
nil
)
saveTestSourceFile
(
t
,
store
,
assignedFile
,
nil
)
// round the current time to the nearest second because some file systems do not support sub-second precision.
now
:=
time
.
Now
()
.
Round
(
time
.
Second
)
// set the timestamps to the current time, so we can compare to result of store.AssignedModified
// set the timestamps to the current time, so we can compare to result of store.AssignedModified
now
:=
time
.
Now
()
err
=
store
.
fs
.
Chtimes
(
store
.
metaPath
(
assignedFile
),
now
,
now
)
err
=
store
.
fs
.
Chtimes
(
store
.
metaPath
(
assignedFile
),
now
,
now
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"could not change timestamps, error: %v"
,
err
)
t
.
Fatalf
(
"could not change timestamps, error: %v"
,
err
)
}
}
// for now we hope that the system won't truncate the time to a less precise unit,
// if this test fails on certain systems that may be the reason.
modTime
,
err
:=
store
.
AssignedModified
()
modTime
,
err
:=
store
.
AssignedModified
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"unable to determine modification time of assigned config source, error: %v"
,
err
)
t
.
Fatalf
(
"unable to determine modification time of assigned config source, error: %v"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment