-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't copy same files twice in copy integration tests #273
Don't copy same files twice in copy integration tests #273
Conversation
howling NOOOOOO |
This might be https://linux.die.net/man/8/sync:
|
f0febb5
to
b614934
Compare
pkg/util/util.go
Outdated
@@ -45,6 +46,7 @@ func Hasher() func(string) (string, error) { | |||
if err != nil { | |||
return "", err | |||
} | |||
logrus.Infof("File %s Mode %s ModTime %s IsRegular %s\n", p, fi.Mode().String(), fi.ModTime().String(), fi.Mode().IsRegular()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to remove this or make it logrus.Debugf since info on every file every time we snapshot could make it difficult to parse through logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I don't want to commit this, I just added this so I could see what was happening with these latest failures 😇
b614934
to
ed15cde
Compare
The default hashing algorithm used by kaniko to determine if two files are the same uses the files' mtime (the inode's modification time). It turns out that this time is not always up to date, meaning that a file could be modified but when you stat the file, the modification time may not yet have been updated. The copy integration tests were adding the same directory twice, the second instance being to test copying a directory with a wilcard '*'. Since the mtime is sometimes not updated, this caused kaniko to sometimes think the files were the same, and sometimes think they were different, varying the number of layers it created. Now we will update those tests to use a completely different set of files instead of copying the same files again. In a later commit (which will hopefully fix GoogleContainerTools#251) we will add a fix for this and a new test case that will intentionally exercise this functionality. In the meantime we'll prevent noisy test failures for submitters.
I _thought_ I was running into cases where Kaniko would fail to build but the test would continue... looks like it was a bug I added!
ed15cde
to
bb4ed13
Compare
Updated this PR to just stop the tests from flaking while we work on a fix for #251. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woot!
The default hashing algorithm used by kaniko to determine if two files
are the same uses the files' mtime (the inode's modification time). It
turns out that this time is not always up to date, meaning that a file
could be modified but when you stat the file, the modification time may
not yet have been updated.
The copy integration tests were adding the same directory twice, the
second instance being to test copying a directory with a wilcard '*'.
Since the mtime is sometimes not updated, this caused kaniko to
sometimes think the files were the same, and sometimes think they were
different, varying the number of layers it created.
Now we will update those tests to use a completely different set of
files instead of copying the same files again.
In a later commit (which will hopefully fix #251) we will add a fix for
this and a new test case that will intentionally exercise this
functionality. In the meantime we'll prevent noisy test failures for
submitters.
Also fixed a bug I introduced into cmd.go 😅