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

net/http: data race in testTransportAndServerSharedBodyRace via t.Logf #63269

Closed
gopherbot opened this issue Sep 27, 2023 · 4 comments
Closed
Assignees
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@gopherbot
Copy link

gopherbot commented Sep 27, 2023

#!watchflakes
post <- pkg == "net/http" && log ~ `WARNING: DATA RACE` && log ~ `net/http_test\.testTransportAndServerSharedBodyRace` && date < "2023-09-28"

Issue created automatically to collect these failures.

Example (log):

==================
WARNING: DATA RACE
Read at 0x00c000250383 by goroutine 910:
  testing.(*common).logDepth()
      /tmp/buildlet/go/src/testing/testing.go:1015 +0x4af
  testing.(*common).log()
      /tmp/buildlet/go/src/testing/testing.go:1002 +0x99
  testing.(*common).Logf()
      /tmp/buildlet/go/src/testing/testing.go:1053 +0x62
  net/http_test.testTransportAndServerSharedBodyRace.func1.1()
...
      /tmp/buildlet/go/src/testing/testing.go:2050 +0x896
  testing.(*M).Run()
      /tmp/buildlet/go/src/testing/testing.go:1923 +0xb57
  net/http_test.TestMain()
      /tmp/buildlet/go/src/net/http/main_test.go:24 +0x64
  main.main()
      _testmain.go:1197 +0x307
==================
--- FAIL: TestResponseWriterWriteString (0.00s)
    testing.go:1463: race detected during execution of test

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 27, 2023
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "net/http" && test == "TestResponseWriterWriteString"
2023-09-27 14:19 darwin-amd64-race go@33d3625b net/http.TestResponseWriterWriteString (log)
==================
WARNING: DATA RACE
Read at 0x00c000250383 by goroutine 910:
  testing.(*common).logDepth()
      /tmp/buildlet/go/src/testing/testing.go:1015 +0x4af
  testing.(*common).log()
      /tmp/buildlet/go/src/testing/testing.go:1002 +0x99
  testing.(*common).Logf()
      /tmp/buildlet/go/src/testing/testing.go:1053 +0x62
  net/http_test.testTransportAndServerSharedBodyRace.func1.1()
...
      /tmp/buildlet/go/src/testing/testing.go:2050 +0x896
  testing.(*M).Run()
      /tmp/buildlet/go/src/testing/testing.go:1923 +0xb57
  net/http_test.TestMain()
      /tmp/buildlet/go/src/net/http/main_test.go:24 +0x64
  main.main()
      _testmain.go:1197 +0x307
==================
--- FAIL: TestResponseWriterWriteString (0.00s)
    testing.go:1463: race detected during execution of test

watchflakes

@bcmills bcmills changed the title net/http: TestResponseWriterWriteString failures net/http: data race in testTransportAndServerSharedBodyRace via t.Logf Sep 28, 2023
@bcmills
Copy link
Contributor

bcmills commented Sep 28, 2023

Fixed in https://go.dev/cl/531195.

@bcmills bcmills closed this as completed Sep 28, 2023
@bcmills bcmills added the Testing An issue that has been verified to require only test changes, not just a test failure. label Sep 28, 2023
@bcmills bcmills self-assigned this Sep 28, 2023
@bcmills bcmills added this to the Go1.22 milestone Sep 28, 2023
@bcmills
Copy link
Contributor

bcmills commented Sep 28, 2023

(This was a particular instance of the more general race reported in #38370.)

@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "net/http" && log ~ `WARNING: DATA RACE` && log ~ `net/http_test\.testTransportAndServerSharedBodyRace`
2023-09-20 18:12 linux-s390x-ibm-race go@6f2e1be1 net/http.TestTolerateCRLFBeforeRequestLine (log)
==================
WARNING: DATA RACE
Read at 0x00c00036dbe3 by goroutine 884:
  testing.(*common).logDepth()
      /data/golang/workdir/go/src/testing/testing.go:1015 +0x54f
  testing.(*common).log()
      /data/golang/workdir/go/src/testing/testing.go:1002 +0xb5
  testing.(*common).Logf()
      /data/golang/workdir/go/src/testing/testing.go:1053 +0x62
  net/http_test.testTransportAndServerSharedBodyRace.func1.1()
...
      /data/golang/workdir/go/src/testing/testing.go:2050 +0xa07
  testing.(*M).Run()
      /data/golang/workdir/go/src/testing/testing.go:1923 +0xcc7
  net/http_test.TestMain()
      /data/golang/workdir/go/src/net/http/main_test.go:24 +0x87
  main.main()
      _testmain.go:1197 +0x35d
==================
--- FAIL: TestTolerateCRLFBeforeRequestLine (0.01s)
    testing.go:1463: race detected during execution of test

watchflakes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
Status: Done
Development

No branches or pull requests

2 participants