YongGoose commented on code in PR #7397:
URL: https://github.com/apache/incubator-seata/pull/7397#discussion_r2121388207


##########
server/src/test/java/org/apache/seata/server/session/FileSessionManagerTest.java:
##########
@@ -470,12 +470,16 @@ public void changeGlobalSessionTest(List<GlobalSession> 
globalSessions) throws E
             Assertions.assertThrows(IllegalArgumentException.class, () ->
                     
globalSessionService.changeGlobalStatus(globalSessions.get(0).getXid()));
 
+            Assertions.assertEquals(GlobalStatus.Begin, 
globalSessions.get(0).getStatus());
+
             GlobalSession globalSession = globalSessions.get(1);
-            globalSession.changeGlobalStatus(GlobalStatus.CommitFailed);
             String xid = globalSession.getXid();
-//            Assertions.assertThrows(ConsoleException.class, () -> 
globalSessionService.changeGlobalStatus(xid));
-            globalSession.changeGlobalStatus(GlobalStatus.RollbackFailed);
-            Assertions.assertThrows(ConsoleException.class, () -> 
globalSessionService.changeGlobalStatus(xid));
+
+            globalSession.changeGlobalStatus(GlobalStatus.CommitFailed);
+            SingleResult<Void> singleResult = 
globalSessionService.changeGlobalStatus(xid);
+
+            Assertions.assertTrue(singleResult.isSuccess());
+            Assertions.assertEquals(GlobalStatus.Committed, 
globalSession.getStatus());

Review Comment:
   Tomorrow is a public holiday in South Korea, so I’ll make sure to finish the 
work by then.
   I’ll also try reordering the unit tests as you suggested.



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