test: fixed the TestUnixSocket test on windows (#2595)

Co-authored-by: thinkerou <thinkerou@gmail.com>
This commit is contained in:
Jeff 2021-01-11 09:07:45 +08:00 committed by GitHub
parent a28cc088b5
commit 4d2dad5961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"os" "os"
"path/filepath"
"sync" "sync"
"testing" "testing"
"time" "time"
@ -146,7 +147,7 @@ func TestRunWithPort(t *testing.T) {
func TestUnixSocket(t *testing.T) { func TestUnixSocket(t *testing.T) {
router := New() router := New()
unixTestSocket := "/tmp/unix_unit_test" unixTestSocket := filepath.Join(os.TempDir(), "unix_unit_test")
defer os.Remove(unixTestSocket) defer os.Remove(unixTestSocket)