e10c7b3f07
The "TestChangesWithChanges" case randomlly fails on my development VM with the following errors: ``` --- FAIL: TestChangesWithChanges (0.00s) changes_test.go:201: no change for expected change C /dir1/subfolder != A /dir1/subfolder/newFile ``` If I apply the following patch to changes_test.go, the test passes. ```diff diff --git a/pkg/archive/changes_test.go b/pkg/archive/changes_test.go index 290b2dd..ba1aca0 100644 --- a/pkg/archive/changes_test.go +++ b/pkg/archive/changes_test.go @@ -156,6 +156,7 @@ func TestChangesWithChanges(t *testing.T) { } defer os.RemoveAll(layer) createSampleDir(t, layer) + time.Sleep(5 * time.Millisecond) os.MkdirAll(path.Join(layer, "dir1/subfolder"), 0740) // Let's modify modtime for dir1 to be sure it's the same for the two layer (to not having false positive) ``` It seems that if a file is created immediately after the directory is created, the `archive.Changes` function could't recognize that the parent directory of the new file is modified. Perhaps the problem may reproduce on machines with low time precision? I had successfully reproduced the failure on my development VM as well as a VM on DigitalOcean. Signed-off-by: Shijiang Wei <mountkin@gmail.com> |
||
---|---|---|
archive | ||
broadcastwriter | ||
chrootarchive | ||
devicemapper | ||
directory | ||
fileutils | ||
graphdb | ||
homedir | ||
httputils | ||
ioutils | ||
jsonlog | ||
jsonmessage | ||
listenbuffer | ||
mflag | ||
mount | ||
namesgenerator | ||
parsers | ||
pidfile | ||
plugins | ||
pools | ||
progressreader | ||
promise | ||
proxy | ||
pubsub | ||
random | ||
reexec | ||
signal | ||
sockets | ||
stdcopy | ||
streamformatter | ||
stringid | ||
stringutils | ||
symlink | ||
sysinfo | ||
system | ||
systemd | ||
tailfile | ||
tarsum | ||
term | ||
timeoutconn | ||
timeutils | ||
tlsconfig | ||
transport | ||
truncindex | ||
ulimit | ||
units | ||
urlutil | ||
useragent | ||
version | ||
README.md |
pkg/ is a collection of utility packages used by the Docker project without being specific to its internals.
Utility packages are kept separate from the docker core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Docker organization, to facilitate re-use by other projects. However that is not the priority.
The directory pkg
is named after the same directory in the camlistore project. Since Brad is a core
Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!
Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!