ivanzlenko commented on code in PR #5909: URL: https://github.com/apache/ignite-3/pull/5909#discussion_r2115636453
########## modules/network/src/test/java/org/apache/ignite/internal/network/netty/RecoveryHandshakeTest.java: ########## @@ -93,158 +93,178 @@ public class RecoveryHandshakeTest extends BaseIgniteAbstractTest { @Test public void testHandshake() throws Exception { - RecoveryDescriptorProvider clientRecovery = createRecoveryDescriptorProvider(); - RecoveryDescriptorProvider serverRecovery = createRecoveryDescriptorProvider(); + RecoveryDescriptorProvider initiatorRecovery = createRecoveryDescriptorProvider(); + RecoveryDescriptorProvider acceptorRecovery = createRecoveryDescriptorProvider(); - EmbeddedChannel clientSideChannel = createUnregisteredChannel(); - EmbeddedChannel serverSideChannel = createUnregisteredChannel(); + EmbeddedChannel initiatorSideChannel = createUnregisteredChannel(); + EmbeddedChannel acceptorSideChannel = createUnregisteredChannel(); - RecoveryClientHandshakeManager clientHandshakeManager = createRecoveryClientHandshakeManager(clientSideChannel, clientRecovery); - RecoveryServerHandshakeManager serverHandshakeManager = createRecoveryServerHandshakeManager(serverSideChannel, serverRecovery); + RecoveryInitiatorHandshakeManager initiatorHandshakeManager = createRecoveryInitiatorHandshakeManager( + initiatorSideChannel, + initiatorRecovery + ); + RecoveryAcceptorHandshakeManager acceptorHandshakeManager = createRecoveryAcceptorHandshakeManager( + acceptorSideChannel, + acceptorRecovery + ); - setupChannel(clientSideChannel, clientHandshakeManager, noMessageListener); - setupChannel(serverSideChannel, serverHandshakeManager, noMessageListener); + setupChannel(initiatorSideChannel, initiatorHandshakeManager, noMessageListener); + setupChannel(acceptorSideChannel, acceptorHandshakeManager, noMessageListener); - assertTrue(serverSideChannel.isActive()); + assertTrue(acceptorSideChannel.isActive()); - exchangeClientToServer(serverSideChannel, clientSideChannel); - exchangeServerToClient(serverSideChannel, clientSideChannel); - exchangeClientToServer(serverSideChannel, clientSideChannel); - exchangeServerToClient(serverSideChannel, clientSideChannel); + exchangeInitiatorToAcceptor(acceptorSideChannel, initiatorSideChannel); + exchangeAcceptorToInitiator(acceptorSideChannel, initiatorSideChannel); + exchangeInitiatorToAcceptor(acceptorSideChannel, initiatorSideChannel); + exchangeAcceptorToInitiator(acceptorSideChannel, initiatorSideChannel); - assertNull(clientSideChannel.readOutbound()); - assertNull(serverSideChannel.readOutbound()); + assertNull(initiatorSideChannel.readOutbound()); + assertNull(acceptorSideChannel.readOutbound()); - checkHandshakeCompleted(serverHandshakeManager); - checkHandshakeCompleted(clientHandshakeManager); + checkHandshakeCompleted(acceptorHandshakeManager); + checkHandshakeCompleted(initiatorHandshakeManager); - checkPipelineAfterHandshake(serverSideChannel); - checkPipelineAfterHandshake(clientSideChannel); + checkPipelineAfterHandshake(acceptorSideChannel); + checkPipelineAfterHandshake(initiatorSideChannel); - assertFalse(serverSideChannel.finish()); - assertFalse(clientSideChannel.finish()); + assertFalse(acceptorSideChannel.finish()); + assertFalse(initiatorSideChannel.finish()); } @Test - public void testHandshakeWithUnacknowledgedServerMessage() throws Exception { - RecoveryDescriptorProvider clientRecovery = createRecoveryDescriptorProvider(); - RecoveryDescriptorProvider serverRecovery = createRecoveryDescriptorProvider(); - - EmbeddedChannel clientSideChannel = createUnregisteredChannel(); - EmbeddedChannel serverSideChannel = createUnregisteredChannel(); - - UUID clientLaunchId = UUID.randomUUID(); - RecoveryDescriptor serverRecoveryDescriptor = serverRecovery.getRecoveryDescriptor("client", clientLaunchId, CONNECTION_ID); - addUnacknowledgedMessages(serverRecoveryDescriptor); - - RecoveryClientHandshakeManager clientHandshakeManager = createRecoveryClientHandshakeManager( - clientSideChannel, - "client", - clientLaunchId, - clientRecovery + public void testHandshakeWithUnacknowledgedAcceptorMessage() throws Exception { + RecoveryDescriptorProvider initiatorRecovery = createRecoveryDescriptorProvider(); + RecoveryDescriptorProvider acceptorRecovery = createRecoveryDescriptorProvider(); + + EmbeddedChannel initiatorSideChannel = createUnregisteredChannel(); + EmbeddedChannel acceptorSideChannel = createUnregisteredChannel(); + + UUID initiatorLaunchId = UUID.randomUUID(); + RecoveryDescriptor acceptorRecoveryDescriptor = acceptorRecovery.getRecoveryDescriptor( + "initiator", Review Comment: Fixed -- 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...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org