aboutsummaryrefslogtreecommitdiff
path: root/plugin/grpc
diff options
context:
space:
mode:
authorGravatar Eng Zer Jun <engzerjun@gmail.com> 2023-06-17 21:21:01 +0800
committerGravatar GitHub <noreply@github.com> 2023-06-17 15:21:01 +0200
commitb868350fc2823f429cc828558f3425d5135e680f (patch)
treeab6af66c78d1d0ca1c5bf289d6664317af3a397b /plugin/grpc
parent06cd8439182be8b9ed17280eaae411f9afb7c8f2 (diff)
downloadcoredns-b868350fc2823f429cc828558f3425d5135e680f.tar.gz
coredns-b868350fc2823f429cc828558f3425d5135e680f.tar.zst
coredns-b868350fc2823f429cc828558f3425d5135e680f.zip
test: use `t.TempDir` to create temporary test directory (#6164)
Diffstat (limited to 'plugin/grpc')
-rw-r--r--plugin/grpc/proxy_test.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/plugin/grpc/proxy_test.go b/plugin/grpc/proxy_test.go
index 534fde3d7..2ca0b1b48 100644
--- a/plugin/grpc/proxy_test.go
+++ b/plugin/grpc/proxy_test.go
@@ -4,7 +4,6 @@ import (
"context"
"errors"
"net"
- "os"
"path"
"testing"
@@ -72,11 +71,7 @@ func (m testServiceClient) Query(ctx context.Context, in *pb.DnsPacket, opts ...
}
func TestProxyUnix(t *testing.T) {
- tdir, err := os.MkdirTemp("", "tmp*")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(tdir)
+ tdir := t.TempDir()
fd := path.Join(tdir, "test.grpc")
listener, err := net.Listen("unix", fd)