BewareMyPower commented on code in PR #1502:
URL: https://github.com/apache/pulsar-client-go/pull/1502#discussion_r3333106229
##########
pulsar/blue_green_migration_test.go:
##########
@@ -148,6 +149,7 @@ func testTopicMigrate(
// Signals both producer and consumer have processed
`messageCountBeforeUnload` messages
wgSendAndReceiveMessages := sync.WaitGroup{}
wgSendAndReceiveMessages.Add(2)
+ errCh := make(chan error, 1)
Review Comment:
Continue the previous
[discussion](https://github.com/apache/pulsar-client-go/pull/1502#discussion_r3332506349)
here.
Since this channel could only be sent once because every `select { case
errCh<- xxx, default }` block is followed by a return.
```go
select {
case <-doneCh:
return true
case err := <-errCh:
req.NoError(err, stage)
return false
```
However, it's possible that both `doneCh` and `errCh` have a message, in
this case, any of them can be chosen randomly.
Therefore, I suggest just storing errors into a slice and check the errors
in the `case <-doneCh` case.
--
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]