shunping commented on code in PR #36235:
URL: https://github.com/apache/beam/pull/36235#discussion_r2370820269


##########
sdks/go/pkg/beam/runners/prism/internal/jobservices/server_test.go:
##########
@@ -121,6 +132,30 @@ func TestServer_RunThenCancel(t *testing.T) {
                t.Fatalf("server.Run() = returned empty preparation ID, want 
non-empty")
        }
 
+       // Wait for the job to be in the RUNNING state before we cancel it.
+       const (
+               maxRetries = 10
+               retrySleep = 100 * time.Millisecond
+       )
+       var jobIsRunning bool
+       for range maxRetries {
+               stateResp, err := undertest.GetState(ctx, 
&jobpb.GetJobStateRequest{JobId: runResp.GetJobId()})

Review Comment:
   I have replaced this waiting part with a waitgroup, which is more concise 
and clear.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to