re PR go/89406 (Go testing leaves many temporary directories in /tmp around)
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 22 Feb 2019 00:47:30 +0000 (00:47 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 22 Feb 2019 00:47:30 +0000 (00:47 +0000)
PR go/89406
    net: remove unixgram test sockets

    Backport https://golang.org/cl/163277 from the master library.

    Updates https://gcc.gnu.org/PR89406

    Reviewed-on: https://go-review.googlesource.com/c/163200

From-SVN: r269087

gcc/go/gofrontend/MERGE
libgo/go/net/listen_test.go
libgo/go/net/mockserver_test.go
libgo/go/net/splice_test.go

index 0a70b3a260c152239c2f72cd7004f8bb2ec4a9d6..a1cd9247996c629187ebfe79dccd6d010e80727d 100644 (file)
@@ -1,4 +1,4 @@
-4fbd06dc7b1b8fb665293399a2b6d5326435512f
+45a2e231958854fd945961f0335ac0805d502510
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 6c3f70cc7bf7e42ac3129edd0848659edf3d4315..6c9b92a9fc5d30f49f2b4350781bb2445ce9fa49 100644 (file)
@@ -780,6 +780,9 @@ func TestListenConfigControl(t *testing.T) {
                                continue
                        }
                        c.Close()
+                       if network == "unixgram" {
+                               os.Remove(address)
+                       }
                }
        })
 }
index 530293578a08e67b8649a4cff691127b0216a2fc..e085f4440b522e133333f76b52616278a77e427f 100644 (file)
@@ -17,8 +17,6 @@ import (
 )
 
 // testUnixAddr uses ioutil.TempFile to get a name that is unique.
-// It also uses /tmp directory in case it is prohibited to create UNIX
-// sockets in TMPDIR.
 func testUnixAddr() string {
        f, err := ioutil.TempFile("", "go-nettest")
        if err != nil {
index 26e3ac4bb14b4c515f73b979702c0b5d147b2779..324103edf8b6f6c510743ce5434adb36f0ca9823 100644 (file)
@@ -242,6 +242,7 @@ func testSpliceNoUnixgram(t *testing.T) {
        if err != nil {
                t.Fatal(err)
        }
+       defer os.Remove(addr.Name)
        up, err := ListenUnixgram("unixgram", addr)
        if err != nil {
                t.Fatal(err)