{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/18603","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/18603/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/18603/comments","events_url":"https://api.github.com/repos/golang/go/issues/18603/events","html_url":"https://github.com/golang/go/issues/18603","id":199974682,"number":18603,"title":"testing: are T.Run and B.Run safe for concurrent use?","user":{"login":"tombergan","id":13954200,"avatar_url":"https://avatars0.githubusercontent.com/u/13954200?v=4","gravatar_id":"","url":"https://api.github.com/users/tombergan","html_url":"https://github.com/tombergan","followers_url":"https://api.github.com/users/tombergan/followers","following_url":"https://api.github.com/users/tombergan/following{/other_user}","gists_url":"https://api.github.com/users/tombergan/gists{/gist_id}","starred_url":"https://api.github.com/users/tombergan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombergan/subscriptions","organizations_url":"https://api.github.com/users/tombergan/orgs","repos_url":"https://api.github.com/users/tombergan/repos","events_url":"https://api.github.com/users/tombergan/events{/privacy}","received_events_url":"https://api.github.com/users/tombergan/received_events","type":"User","site_admin":false},"labels":[{"id":150880209,"url":"https://api.github.com/repos/golang/go/labels/Documentation","name":"Documentation","color":"aaffaa","default":false},{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false},{"id":626114820,"url":"https://api.github.com/repos/golang/go/labels/release-blocker","name":"release-blocker","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/56","html_url":"https://github.com/golang/go/milestone/56","labels_url":"https://api.github.com/repos/golang/go/milestones/56/labels","id":2473074,"number":56,"title":"Go1.10","description":"","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":835,"closed_issues":77,"state":"open","created_at":"2017-04-21T19:22:29Z","updated_at":"2017-08-02T19:36:38Z","due_on":"2018-01-31T08:00:00Z","closed_at":null},"comments":4,"created_at":"2017-01-11T00:47:08Z","updated_at":"2017-08-02T20:27:42Z","closed_at":null,"body":"I do not see any documentation specifying if T.Run is safe for concurrent use. I see the following doc for [testing.T](https://tip.golang.org/pkg/testing/#T), which does not mention T.Run:\r\n\r\n> A test ends when its Test function returns or calls any of the methods FailNow, Fatal, Fatalf, SkipNow, Skip, or Skipf. Those methods, as well as the Parallel method, must be called only from the goroutine running the Test function.\r\n>\r\n> The other reporting methods, such as the variations of Log and Error, may be called simultaneously from multiple goroutines.\r\n\r\nThere is a similar doc for [testing.B](https://tip.golang.org/pkg/testing/#B).\r\n\r\nI ask because I believe T.Run was safe for concurrent use in go 1.7. Then, [this line](https://github.com/golang/go/blob/7fb16406139e934d84f7ec66ba440a772747270a/src/testing/testing.go#L663) was added in go 1.8, which made T.Run no longer safe for concurrent use. I don't particularly care whether T.Run is safe for concurrent use, but I think the semantics should be clarified.\r\n\r\nOptimistically labeling this go1.8.\r\n\r\n/cc @dsnet "},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/319788433","html_url":"https://github.com/golang/go/issues/18603#issuecomment-319788433","issue_url":"https://api.github.com/repos/golang/go/issues/18603","id":319788433,"user":{"login":"dsnet","id":6354026,"avatar_url":"https://avatars1.githubusercontent.com/u/6354026?v=4","gravatar_id":"","url":"https://api.github.com/users/dsnet","html_url":"https://github.com/dsnet","followers_url":"https://api.github.com/users/dsnet/followers","following_url":"https://api.github.com/users/dsnet/following{/other_user}","gists_url":"https://api.github.com/users/dsnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dsnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsnet/subscriptions","organizations_url":"https://api.github.com/users/dsnet/orgs","repos_url":"https://api.github.com/users/dsnet/repos","events_url":"https://api.github.com/users/dsnet/events{/privacy}","received_events_url":"https://api.github.com/users/dsnet/received_events","type":"User","site_admin":false},"created_at":"2017-08-02T20:27:42Z","updated_at":"2017-08-02T20:27:42Z","body":"Is this a documentation issue or a implementation issue? cl/35354 does have a test for multiple goroutines using when using `testing.T.Run`, but lacks a test for `testing.B.Run`, which clearly seems broken.\r\n\r\nAre you proposing we properly making `testing.B.Run` work also? or just remove the comment."}}
{"actor":{"display_login":"dsnet"}}