mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 01:45:44 +03:00
tests: failover to copying when symlinking fails
Symlinking busybox may fail when the test code and the test temporary directory live on different volumes/partitions; so we should copy instead. This situation arises in the Vagrant setup, where the code repository live on special file sharing volume. Somewhat unrelated, remove `f.Sync()` invocation from a test copyFile helper function. Sync is useful only for crash recovery, and isn't necessary in our test setup. The sync invocation is a significant overhead as it requires the OS to flush any cached writes to disk.
This commit is contained in:
@@ -332,9 +332,6 @@ func copyFile(src, dst string, t *testing.T) {
|
||||
if _, err = io.Copy(out, in); err != nil {
|
||||
t.Fatalf("copying %v -> %v failed: %v", src, dst, err)
|
||||
}
|
||||
if err := out.Sync(); err != nil {
|
||||
t.Fatalf("copying %v -> %v failed: %v", src, dst, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfig_ParseAllHCL(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user