public void replayLoadDynamicPlugin(PluginInfo info) throws IOException, UserException {
        DynamicPluginLoader pluginLoader = new DynamicPluginLoader(Config.plugin_dir, info);
        try {
            // should add to "plugins" first before loading.
            PluginLoader checkLoader = plugins[info.getTypeId()].putIfAbsent(info.getName(), pluginLoader);
            if (checkLoader != null) {
                throw new UserException("plugin " + info.getName() + " has already been installed.");
            }

            pluginLoader.setStatus(PluginStatus.INSTALLING);
            // install plugin
            pluginLoader.reload();
            pluginLoader.setStatus(PluginStatus.INSTALLED);
        } catch (IOException | UserException e) {
            pluginLoader.setStatus(PluginStatus.ERROR, e.getMessage());
            LOG.warn("fail to load plugin", e);
        } finally {
            // this is a replay process, so whether it is successful or not, add it's name.
            addDynamicPluginNameIfAbsent(info.getName());
        }
    }
@Test
    public void testLoadPluginFail() {
        try {

            PluginMgr pluginMgr = GlobalStateMgr.getCurrentState().getPluginMgr();
            PluginInfo info = new PluginInfo();
            info.name = "plugin-name";
            info.type = PluginType.AUDIT;
            info.description = "plugin description";
            info.version = DigitalVersion.CURRENT_STARROCKS_VERSION;
            info.javaVersion = DigitalVersion.JDK_1_8_0;
            info.className = "hello.jar";
            info.soName = "hello.so";
            info.source = "test";
            info.properties.put("md5sum", "cf0c536b8f2a0a0690b44d783d019e90");
            pluginMgr.replayLoadDynamicPlugin(info);

        } catch (IOException | UserException e) {
            e.printStackTrace();
            assert false;
        }
    }