[ https://issues.apache.org/jira/browse/BEAM-10206?focusedWorklogId=712173&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-712173 ]
ASF GitHub Bot logged work on BEAM-10206: ----------------------------------------- Author: ASF GitHub Bot Created on: 20/Jan/22 16:31 Start Date: 20/Jan/22 16:31 Worklog Time Spent: 10m Work Description: lostluck commented on a change in pull request #16575: URL: https://github.com/apache/beam/pull/16575#discussion_r788940176 ########## File path: sdks/go/pkg/beam/core/runtime/exec/pardo_test.go ########## @@ -132,10 +132,12 @@ func BenchmarkParDo_EmitSumFn(b *testing.B) { } go func() { if err := p.Execute(context.Background(), "1", DataContext{}); err != nil { - b.Fatalf("execute failed: %v", err) + b.Errorf("execute failed: %v", err) Review comment: I gather the issue vet/staticcheck has is that the "fatal" doesn't end the test? Since usually seeing the combo of "error " return means one must translate it back to fatal, consider adding another comment to the effect about the goroutines, and the vet warning. I assume though that this fix lets staticcheck and vet run cleanly on this issue. Alternatively to unambiguously avoid the different lint trigger: Add a new buffered channel `errchan` that takes in a string. Then send the message and close the channel (though a `defer close(errchan)` at the top of the goroutine is also good. Receive on the errchan at the end of the benchmark function (after closing `process`), and print out any out put to b.Fatal. (Yes we lose line locality, but we can make that up in message verbosity). This then blocks the benchmark until the goroutine shuts down, which will close the channel and unblock exit. ``` close(process) for msg := range errchan { b.Fatal(msg) } ``` The rule of thumb here is "the channel writer should close the channel". -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 712173) Time Spent: 3h 20m (was: 3h 10m) > [Go SDK] Jenkins static checks > -------------------------------- > > Key: BEAM-10206 > URL: https://issues.apache.org/jira/browse/BEAM-10206 > Project: Beam > Issue Type: Improvement > Components: sdk-go > Reporter: Robert Burke > Priority: P3 > Labels: starter > Time Spent: 3h 20m > Remaining Estimate: 0h > > We should probably hook up static checks > [https://staticcheck.io|https://staticcheck.io/] to avoid style and lint > regressions, and to run them locally and fix most of them. > Additional configuration we could probably integrate should take the proto > import conventions we've established (see PR 11927) so that we use consistent > short names. -- This message was sent by Atlassian Jira (v8.20.1#820001)