Skip to content

Commit

Permalink
Fix test file creation when /tmp is on a different partition (#1799)
Browse files Browse the repository at this point in the history
* Fix test file creation when /tmp is on a different partition

Signed-off-by: Francis Moloney <[email protected]>

* PR feedback, move file is to prevent race condition when writing

Signed-off-by: Francis Moloney <[email protected]>
  • Loading branch information
herojan authored Jul 5, 2021
1 parent f606f7a commit a4a2f39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions eskipfile/watch_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package eskipfile

import (
"io/ioutil"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit a4a2f39

Please sign in to comment.