]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/go: remove unused (*testgoData).acquireNet test helper
authorTobias Klauser <tklauser@distanz.ch>
Wed, 25 Oct 2023 08:20:29 +0000 (10:20 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Wed, 25 Oct 2023 19:47:04 +0000 (19:47 +0000)
It's unused since CL 518775.

Change-Id: Ic889f0cf1555a8503d0c2b3fb232854609d72764
Reviewed-on: https://go-review.googlesource.com/c/go/+/537597
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/go/go_test.go

index 1e28bec92d0a3fc717aacff387cdd73445cc71a7..bae83eb92fa2e42c5c5678eda753d6574c2af99a 100644 (file)
@@ -391,7 +391,6 @@ type testgoData struct {
        tempdir        string
        ran            bool
        inParallel     bool
-       hasNet         bool
        stdout, stderr bytes.Buffer
        execDir        string // dir for tg.run
 }
@@ -434,9 +433,6 @@ func (tg *testgoData) parallel() {
        if tg.ran {
                tg.t.Fatal("internal testsuite error: call to parallel after run")
        }
-       if tg.hasNet {
-               tg.t.Fatal("internal testsuite error: call to parallel after acquireNet")
-       }
        for _, e := range tg.env {
                if strings.HasPrefix(e, "GOROOT=") || strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "GOBIN=") {
                        val := e[strings.Index(e, "=")+1:]
@@ -449,25 +445,6 @@ func (tg *testgoData) parallel() {
        tg.t.Parallel()
 }
 
-// acquireNet skips t if the network is unavailable, and otherwise acquires a
-// netTestSem token for t to be released at the end of the test.
-//
-// t.Parallel must not be called after acquireNet.
-func (tg *testgoData) acquireNet() {
-       tg.t.Helper()
-       if tg.hasNet {
-               return
-       }
-
-       testenv.MustHaveExternalNetwork(tg.t)
-       if netTestSem != nil {
-               netTestSem <- struct{}{}
-               tg.t.Cleanup(func() { <-netTestSem })
-       }
-       tg.setenv("TESTGONETWORK", "")
-       tg.hasNet = true
-}
-
 // pwd returns the current directory.
 func (tg *testgoData) pwd() string {
        tg.t.Helper()