open-nomad/client/allocdir
Michael Schurter e5a29b82db Fix allocdir Move test and make code more defensive
A change in the behavior of `os.Rename` in Go 1.8 brought to light a
difference in the logic between `{Alloc,Task}Runner` and this test:

AllocRunner builds the alloc dir, moves dirs if necessary, and then lets
TaskRunner call TaskDir.Build().

This test called `TaskDir.Build` *before* `AllocDir.Move`, so in Go 1.8
it failed to `os.Rename over` the empty {data,local} dirs.

I updated the test to behave like the real code, but I defensively added
`os.Remove` calls as a subtle change in call order shouldn't break this
code. `os.Remove` won't remove a non-empty directory, so it's still
safe.
2017-02-21 17:22:10 -08:00
..
alloc_dir.go Fix allocdir Move test and make code more defensive 2017-02-21 17:22:10 -08:00
alloc_dir_test.go Fix allocdir Move test and make code more defensive 2017-02-21 17:22:10 -08:00
fs_darwin.go Move chroot building into TaskRunner 2017-01-05 16:31:49 -08:00
fs_freebsd.go Move chroot building into TaskRunner 2017-01-05 16:31:49 -08:00
fs_linux.go Move chroot building into TaskRunner 2017-01-05 16:31:49 -08:00
fs_unix.go Move chroot building into TaskRunner 2017-01-05 16:31:49 -08:00
fs_windows.go Move chroot building into TaskRunner 2017-01-05 16:31:49 -08:00
task_dir.go Don't link shared alloc dir into task dir for raw_exec 2017-01-18 11:28:34 -08:00
task_dir_linux.go Move chroot building into TaskRunner 2017-01-05 16:31:49 -08:00
task_dir_nonlinux.go Move chroot building into TaskRunner 2017-01-05 16:31:49 -08:00
task_dir_test.go Don't link shared alloc dir into task dir for raw_exec 2017-01-18 11:28:34 -08:00