Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bughue committed Jul 30, 2024
1 parent 5d1831c commit ea8d872
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions test-old-version/src/test/java/io/seata/MockTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ private String doTestCommit(int times) throws TransactionException, NoSuchMethod
TransactionManager tm = TmClientTest.getTm();
DefaultResourceManager rm = RmClientTest.getRm(RESOURCE_ID);

String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test", 60000);
String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test-commit", 60000);
logger.info("doTestCommit(0.6.1) xid:{}", xid);
MockCoordinator.getInstance().setExpectedRetry(xid, times);
Long branchId = rm.branchRegister(BranchType.TCC, RESOURCE_ID, "1", xid, "{\"mock\":\"mock\"}", "1");
logger.info("branch register ok, branchId=" + branchId);
logger.info("branch register(0.6.1) ok, branchId=" + branchId);
GlobalStatus commit = tm.commit(xid);
Assertions.assertEquals(GlobalStatus.Committed, commit);
return xid;
Expand All @@ -113,11 +114,11 @@ private String doTestRollback(int times) throws TransactionException, NoSuchMeth
TransactionManager tm = TmClientTest.getTm();
DefaultResourceManager rm = RmClientTest.getRm(RESOURCE_ID);

String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test", 60000);
logger.info("doTestRollback xid:{}", xid);
String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test-rollback", 60000);
logger.info("doTestRollback(0.6.1) xid:{}", xid);
MockCoordinator.getInstance().setExpectedRetry(xid, times);
Long branchId = rm.branchRegister(BranchType.TCC, RESOURCE_ID, "1", xid, "{\"mock\":\"mock\"}", "1");
logger.info("branch register ok, branchId=" + branchId);
logger.info("branch register(0.6.1) ok, branchId=" + branchId);
GlobalStatus rollback = tm.rollback(xid);
Assertions.assertEquals(GlobalStatus.Rollbacked, rollback);
return xid;
Expand Down
2 changes: 1 addition & 1 deletion test-old-version/src/test/resources/file.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ service {
vgroup_mapping.default_tx_group = "default"
vgroup_mapping.mock_tx_group = "mock"
#only support when registry.type=file, please don't set multiple addresses
default.grouplist = "127.0.0.1:8077"
default.grouplist = "127.0.0.1:8078"
mock.grouplist = "127.0.0.1:8077"
#disable seata
disableGlobalTransaction = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private String doTestCommit(int times) throws TransactionException {
TransactionManager tm = TmClientTest.getTm();
DefaultResourceManager rm = RmClientTest.getRm(RESOURCE_ID);

String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test", 60000);
String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test-commit", 60000);
MockCoordinator.getInstance().setExpectedRetry(xid, times);
Long branchId = rm.branchRegister(BranchType.TCC, RESOURCE_ID, "1", xid, "{\"mock\":\"mock\"}", "1");
GlobalStatus commit = tm.commit(xid);
Expand All @@ -117,7 +117,7 @@ private String doTestRollback(int times) throws TransactionException {
TransactionManager tm = TmClientTest.getTm();
DefaultResourceManager rm = RmClientTest.getRm(RESOURCE_ID);

String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test", 60000);
String xid = tm.begin(ProtocolTestConstants.APPLICATION_ID, ProtocolTestConstants.SERVICE_GROUP, "test-rollback", 60000);
logger.info("doTestRollback xid:{}", xid);
MockCoordinator.getInstance().setExpectedRetry(xid, times);
Long branchId = rm.branchRegister(BranchType.TCC, RESOURCE_ID, "1", xid, "{\"mock\":\"mock\"}", "1");
Expand Down

0 comments on commit ea8d872

Please sign in to comment.