void registerSelfToCluster(String groupId, PeerId selfIp, Configuration conf) {
        while (!isShutdown) {
            try {
                List<PeerId> peerIds = cliService.getPeers(groupId, conf);
                if (peerIds.contains(selfIp)) {
                    return;
                }
                Status status = cliService.addPeer(groupId, conf, selfIp);
                if (status.isOk()) {
                    return;
                }
                Loggers.RAFT.warn("Failed to join the cluster, retry...");
            } catch (Exception e) {
                Loggers.RAFT.error("Failed to join the cluster, retry...", e);
            }
            ThreadUtils.sleep(1_000L);
        }
    }
@Test
    void testRegisterSelfToCluster() {
        PeerId selfPeerId = new PeerId("4.4.4.4", 8080);
        server.registerSelfToCluster(groupId, selfPeerId, conf);
        verify(cliServiceMock).addPeer(groupId, conf, selfPeerId);
    }