@Ignore
  @Test
  public void test() throws IOException, ConsensusException, InterruptedException {
    // start configManager for the first time
    ConfigManager configManager = new ConfigManager();
    conf.setConfigNodeId(0);
    conf.setInternalAddress("127.0.0.1");
    configManager.initConsensusManager();

    // write some raft logs to increase index, otherwise cannot take snapshot
    configManager.getConsensusManager().write(new TestOnlyPlan());
    configManager.getConsensusManager().write(new TestOnlyPlan());
    configManager.getConsensusManager().write(new TestOnlyPlan());

    ProcedureInfo procedureInfo = configManager.getProcedureManager().getStore().getProcedureInfo();
    ConfigProcedureStore.createOldProcWalDir();
    List<TDataNodeLocation> removedDataNodes =
        Arrays.asList(
            new TDataNodeLocation(
                10000,
                new TEndPoint("127.0.0.1", 6600),
                new TEndPoint("127.0.0.1", 7700),
                new TEndPoint("127.0.0.1", 8800),
                new TEndPoint("127.0.0.1", 9900),
                new TEndPoint("127.0.0.1", 11000)),
            new TDataNodeLocation(
                10001,
                new TEndPoint("127.0.0.1", 6601),
                new TEndPoint("127.0.0.1", 7701),
                new TEndPoint("127.0.0.1", 8801),
                new TEndPoint("127.0.0.1", 9901),
                new TEndPoint("127.0.0.1", 11001)));

    // prepare procedures
    Map<Integer, NodeStatus> nodeStatusMap = new HashMap<>();
    nodeStatusMap.put(10000, NodeStatus.Running);
    nodeStatusMap.put(10001, NodeStatus.Running);
    RemoveDataNodesProcedure removeDataNodesProcedure =
        new RemoveDataNodesProcedure(removedDataNodes, nodeStatusMap);
    removeDataNodesProcedure.setProcId(10086);
    AddConfigNodeProcedure addConfigNodeProcedure =
        new AddConfigNodeProcedure(
            new TConfigNodeLocation(
                0, new TEndPoint("0.0.0.0", 22277), new TEndPoint("0.0.0.0", 22278)),
            new TNodeVersionInfo());
    addConfigNodeProcedure.setProcId(888888);
    List<Procedure> procedureList =
        Arrays.asList(
            new NeverFinishProcedure(0),
            removeDataNodesProcedure,
            new NeverFinishProcedure(199),
            addConfigNodeProcedure,
            new NeverFinishProcedure(29999));
    procedureList.forEach(
        procedure -> procedureInfo.oldUpdateProcedure(new UpdateProcedurePlan(procedure)));

    // take snapshot manually
    procedureInfo.oldLoad();
    procedureInfo.upgrade();
    // check if wal files deleted
    Assert.assertFalse(procedureInfo.isOldVersion());

    // reactivate configManager to load snapshot
    configManager.close();
    configManager = new ConfigManager();
    configManager.initConsensusManager();
    // check procedures which loaded from snapshot
    List<Procedure<ConfigNodeProcedureEnv>> newProcedureList =
        configManager.getProcedureManager().getStore().getProcedureInfo().getProcedures();
    Assert.assertEquals(procedureList.size(), newProcedureList.size());
    Assert.assertTrue(newProcedureList.containsAll(procedureList));
  }
This test will fully start the ConfigManager, generating some files that cannot be cleaned up,
which will affect other tests. Therefore, this test is not enabled by default.
iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/procedure/UpgradeFromWALToConsensusLayerTest.java