Copilot commented on code in PR #1170:
URL: 
https://github.com/apache/incubator-seata-go/pull/1170#discussion_r4028747764


##########
pkg/remoting/processor/client/rm_branch_commit_processor_test.go:
##########
@@ -109,3 +114,51 @@ func TestRmBranchCommitProcessor(t *testing.T) {
                })
        }
 }
+
+func TestRmBranchCommitProcessorResponseUsesCommitResultMessageType(t 
*testing.T) {
+       resourceManager := &testGrpcResourceManager{branchType: 
model2.BranchTypeTCC}
+       rm.GetRmCacheInstance().RegisterResourceManager(resourceManager)
+       defer 
rm.GetRmCacheInstance().UnregisterResourceManager(model2.BranchTypeTCC)
+       config.InitTransportConfig(&config.TransportConfig{Protocol: "grpc"})

Review Comment:
   `config.InitTransportConfig(...)` mutates global transport config without 
resetting it, which can leak state into other tests (especially if additional 
tests in this package expect a different protocol). Consider capturing the 
current transport config and restoring it using `t.Cleanup(...)` so this 
regression test remains hermetic.



##########
pkg/remoting/grpc/channel_manager_test.go:
##########
@@ -67,6 +70,28 @@ func 
TestChannelManagerRefreshesServerListFromRegistrySubscription(t *testing.T)
        startMu.Unlock()
 }
 
+func TestChannelManagerRegisterTMUsesClientRegistrationMessageType(t 
*testing.T) {
+       config.InitSeataConfig(&config.SeataConfig{
+               ApplicationID:  "test-app",
+               TxServiceGroup: "test-group",
+       })

Review Comment:
   `config.InitSeataConfig(...)` updates global configuration but the test 
doesn’t restore the previous values. This can create order-dependent failures 
in other tests within the same package/process. Consider saving the prior 
config and restoring it via `t.Cleanup(...)` (or providing a test-local config 
setter) to keep the test isolated.



##########
pkg/remoting/processor/client/rm_branch_rollback_processor_test.go:
##########
@@ -109,3 +114,34 @@ func TestRmBranchRollbackProcessor(t *testing.T) {
                })
        }
 }
+
+func TestRmBranchRollbackProcessorResponseUsesRollbackResultMessageType(t 
*testing.T) {
+       resourceManager := &testGrpcResourceManager{branchType: 
model2.BranchTypeTCC}
+       rm.GetRmCacheInstance().RegisterResourceManager(resourceManager)

Review Comment:
   `testGrpcResourceManager` is referenced here but is defined in a different 
`_test.go` file (`rm_branch_commit_processor_test.go`). This creates an 
implicit coupling between tests/files that makes the rollback test harder to 
understand and maintain in isolation. Consider moving `testGrpcResourceManager` 
into a shared test helper file (e.g., 
`pkg/remoting/processor/client/test_helpers_test.go`) so both tests depend on 
an explicit common fixture.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to