sbinet commented on a change in pull request #7823:
URL: https://github.com/apache/arrow/pull/7823#discussion_r466958913
##########
File path: go/arrow/arrio/arrio_test.go
##########
@@ -94,19 +100,17 @@ func TestCopy(t *testing.T) {
mem :=
memory.NewCheckedAllocator(memory.NewGoAllocator())
defer mem.AssertSize(t,
0)
- f, err :=
ioutil.TempFile("", "arrow-ipc-")
+ f, err :=
ioutil.TempFile(tempDir, "arrow-ipc-")
if err != nil {
t.Fatal(err)
}
defer f.Close()
- defer
os.Remove(f.Name())
- o, err :=
ioutil.TempFile("", "arrow-ipc-")
+ o, err :=
ioutil.TempFile(tempDir, "arrow-ipc-")
Review comment:
ditto
##########
File path: go/arrow/arrio/arrio_test.go
##########
@@ -67,6 +67,12 @@ func (k copyKind) check(t *testing.T, f *os.File, mem
memory.Allocator, schema *
func TestCopy(t *testing.T) {
type kind int
+ tempDir, err := ioutil.TempDir("", "arrow-ipc-")
Review comment:
```suggestion
tempDir, err := ioutil.TempDir("", "arrow-io-")
```
##########
File path: go/arrow/internal/arrjson/arrjson_test.go
##########
@@ -36,12 +42,11 @@ func TestReadWrite(t *testing.T) {
mem :=
memory.NewCheckedAllocator(memory.NewGoAllocator())
defer mem.AssertSize(t, 0)
- f, err := ioutil.TempFile("", "arrjson-")
+ f, err := ioutil.TempFile(tempDir, "arrjson-")
Review comment:
or use the test name to derive a file name?
##########
File path: go/arrow/ipc/cmd/arrow-file-to-stream/main_test.go
##########
@@ -27,25 +27,30 @@ import (
)
func TestFileToStream(t *testing.T) {
+ tempDir, err := ioutil.TempDir("", "arrow-ipc-")
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer os.RemoveAll(tempDir)
+
for name, recs := range arrdata.Records {
t.Run(name, func(t *testing.T) {
mem :=
memory.NewCheckedAllocator(memory.NewGoAllocator())
defer mem.AssertSize(t, 0)
- f, err := ioutil.TempFile("", "arrow-ipc-")
+ f, err := ioutil.TempFile(tempDir, "arrow-ipc-")
Review comment:
ditto, and for all occurrences below.
##########
File path: go/arrow/ipc/cmd/arrow-cat/main_test.go
##########
@@ -515,7 +526,7 @@ record 3/3...
defer mem.AssertSize(t, 0)
fname := func() string {
- f, err := ioutil.TempFile("", "go-arrow-")
+ f, err := ioutil.TempFile(tempDir, "go-arrow-")
Review comment:
ditto.
##########
File path: go/arrow/arrio/arrio_test.go
##########
@@ -94,19 +100,17 @@ func TestCopy(t *testing.T) {
mem :=
memory.NewCheckedAllocator(memory.NewGoAllocator())
defer mem.AssertSize(t,
0)
- f, err :=
ioutil.TempFile("", "arrow-ipc-")
+ f, err :=
ioutil.TempFile(tempDir, "arrow-ipc-")
Review comment:
```suggestion
f, err :=
ioutil.TempFile(tempDir, "arrow-io-")
```
or just use the test name?
##########
File path: go/arrow/ipc/cmd/arrow-cat/main_test.go
##########
@@ -174,7 +180,7 @@ record 3...
defer mem.AssertSize(t, 0)
fname := func() string {
- f, err := ioutil.TempFile("", "go-arrow-")
+ f, err := ioutil.TempFile(tempDir, "go-arrow-")
Review comment:
ditto
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]