protected void setup() throws JournalException, InterruptedException {
        this.closing = false;
        ensureHelperInLocal();
        initConfigs(isElectable);
        setupEnvironment();
    }
@Test
    public void testRollbackExceptionOnSetupCluster(@Mocked RepImpl rep) throws Exception {
        long startMs = System.currentTimeMillis();
        new Expectations() {
            {
                rep.getName();
                minTimes = 0;
                result = "starrocks";

                rep.isValid();
                minTimes = 0;
                result = false;

                rep.getConfigManager();
                minTimes = 0;
                result = new DbConfigManager(new EnvironmentConfig());
            }
        };

        // mock DatabaseUtil.checkForNullParam to generate RollBackException
        new MockUp<DatabaseUtil>() {
            @Mock
            public void checkForNullParam(final Object param, final String name) {
                throw new RollbackException(rep, VLSN.FIRST_VLSN, new MatchpointSearchResults(rep));
            }
        };

        leaderNodeHostPort = findUnbindHostPort();
        leaderPath = createTmpDir();
        // set retry times = 1 to ensure no recovery
        BDBEnvironment.RETRY_TIME = 1;
        // start leader will get rollback exception
        BDBEnvironment maserEnvironment = new BDBEnvironment(
                leaderPath,
                "leader",
                leaderNodeHostPort,
                leaderNodeHostPort,
                true);
        Assert.assertTrue(true);
        try {
            maserEnvironment.setup();
        } catch (JournalException e) {
            LOG.warn("got Rollback Exception, as expect, ", e);
        }
        System.out.println("testRollbackExceptionOnSetupCluster cost " + (System.currentTimeMillis() - startMs) / 1000 + " s");
    }