YongGoose commented on code in PR #7397: URL: https://github.com/apache/incubator-seata/pull/7397#discussion_r2117901107
########## 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: @slievrly I’ve made some changes to the test code — would you mind taking a look and giving some feedback? Specifically, I’m wondering whether it’s correct for `changeGlobalStatus` to set the status to `Committed` when the globalSession is initially set to `CommitFailed`. When I run the tests locally, the status remains `CommitFailed`, but it seems status is changed to `Committed` in the CI environment. --- A new issue has come up. 🤯 Error: Errors: Error: FileSessionManagerTest.restartBranchFailRetryTest:629 » NullPointer Cannot inv... Error: FileTransactionStoreManagerTest.init:55 » NullPointer Cannot invoke "Object.ha... -- 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: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org