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
dfa4e66b
Commit
dfa4e66b
authored
Oct 03, 2016
by
MrHohn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #33784, IN_CREATE event does not guarantee file content written
parent
4f27c740
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
24 deletions
+5
-24
file_linux_test.go
pkg/kubelet/config/file_linux_test.go
+5
-24
No files found.
pkg/kubelet/config/file_linux_test.go
View file @
dfa4e66b
...
...
@@ -261,32 +261,13 @@ func watchFileAdded(watchDir bool, t *testing.T) {
testCase
.
writeToFile
(
dirName
,
fileName
,
t
)
}
if
watchDir
{
defer
func
()
{
// Remove the file
deleteFile
(
dirName
,
fileName
,
ch
,
t
)
}()
}
go
addFile
()
if
watchDir
{
// expect an update by CREATE inotify event
expectUpdate
(
t
,
ch
,
testCase
)
// expect an update by MODIFY inotify event
expectUpdate
(
t
,
ch
,
testCase
)
from
:=
fileName
fileName
=
fileName
+
"_ch"
go
changeFileName
(
dirName
,
from
,
fileName
,
t
)
// expect an update by MOVED_FROM inotify event cause changing file name
expectEmptyUpdate
(
t
,
ch
)
// expect an update by MOVED_TO inotify event cause changing file name
expectUpdate
(
t
,
ch
,
testCase
)
}
else
{
// expect an update by SourceFile.resetStoreFromPath()
expectUpdate
(
t
,
ch
,
testCase
)
}
// For !watchDir: expect an update by SourceFile.resetStoreFromPath().
// For watchDir: expect at least one update from CREATE & MODIFY inotify event.
// Shouldn't expect two updates from CREATE & MODIFY because CREATE doesn't guarantee file written.
// In that case no update will be sent from CREATE event.
expectUpdate
(
t
,
ch
,
testCase
)
}()
}
}
...
...
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