Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: race detected in cmd tests #35436

Open
stamblerre opened this issue Nov 7, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Nov 7, 2019

To reproduce: go test ./internal/lsp/cmd -run=TestCommandLine/Modules/Format -race -count=20

Output:

==================
WARNING: DATA RACE
Write at 0x00c0047bcae0 by goroutine 190:
  golang.org/x/tools/internal/tool.addFlags()
      /usr/lib/google-golang/src/flag/flag.go:112 +0x8ca
  golang.org/x/tools/internal/tool.addFlags()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/tool/tool.go:176 +0xb14
  golang.org/x/tools/internal/tool.Run()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/tool/tool.go:105 +0x134
  golang.org/x/tools/internal/lsp/cmd/test.(*runner).Format.func3()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/lsp/cmd/test/format.go:46 +0x1dc
  golang.org/x/tools/internal/lsp/cmd/test.CaptureStdOut()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/lsp/cmd/test/cmdtest.go:96 +0x1b6
  golang.org/x/tools/internal/lsp/cmd/test.(*runner).Format()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/lsp/cmd/test/format.go:45 +0x5a0
  golang.org/x/tools/internal/lsp/tests.Run.func11.1()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/lsp/tests/tests.go:435 +0x11b
  testing.tRunner()
      /usr/lib/google-golang/src/testing/testing.go:909 +0x199

Previous read at 0x00c0047bcae0 by goroutine 89:
  golang.org/x/tools/internal/lsp/cmd.(*cmdClient).LogMessage()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/lsp/cmd/cmd.go:268 +0x373
  golang.org/x/tools/internal/lsp/protocol.clientHandler.Deliver()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/lsp/protocol/tsclient.go:53 +0x43e
  golang.org/x/tools/internal/lsp/protocol.(*clientHandler).Deliver()
      <autogenerated>:1 +0x94
  golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:370 +0x1c5

Goroutine 190 (running) created at:
  testing.(*T).Run()
      /usr/lib/google-golang/src/testing/testing.go:960 +0x651
  golang.org/x/tools/internal/lsp/tests.Run.func11()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/lsp/tests/tests.go:433 +0x2b5
  testing.tRunner()
      /usr/lib/google-golang/src/testing/testing.go:909 +0x199

Goroutine 89 (finished) created at:
  golang.org/x/tools/internal/jsonrpc2.(*Conn).Run()
      /usr/local/google/home/rstambler/code/src/golang.org/x/tools/internal/jsonrpc2/jsonrpc2.go:354 +0x803
==================
--- FAIL: TestCommandLine (1.38s)
    --- FAIL: TestCommandLine/Modules (1.38s)
        --- FAIL: TestCommandLine/Modules/Format (0.97s)
            --- FAIL: TestCommandLine/Modules/Format/parse_format (0.28s)
                testing.go:853: race detected during execution of test
            testing.go:853: race detected during execution of test
        testing.go:853: race detected during execution of test
    testing.go:853: race detected during execution of test
FAIL
FAIL	golang.org/x/tools/internal/lsp/cmd	28.259s
FAIL

@gopherbot gopherbot added this to the Unreleased milestone Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.