From a4a2f392e743c730832f3531dc988400036545ad Mon Sep 17 00:00:00 2001 From: herojan Date: Mon, 5 Jul 2021 18:33:16 +0100 Subject: [PATCH] Fix test file creation when /tmp is on a different partition (#1799) * Fix test file creation when /tmp is on a different partition Signed-off-by: Francis Moloney * PR feedback, move file is to prevent race condition when writing Signed-off-by: Francis Moloney --- eskipfile/watch_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eskipfile/watch_test.go b/eskipfile/watch_test.go index 22dadfbd65..2a75544da9 100644 --- a/eskipfile/watch_test.go +++ b/eskipfile/watch_test.go @@ -1,7 +1,6 @@ package eskipfile import ( - "io/ioutil" "net/http" "net/url" "os" @@ -45,7 +44,7 @@ func deleteFile(t *testing.T) { } func createFileWith(content string, t *testing.T) { - tmpfile, err := ioutil.TempFile("", "watch_test-*") + tmpfile, err := os.Create(testWatchFile + ".tmp") if err != nil { t.Fatal(err) }