You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
当gradle test运行多个Test时,要求每个Test结束时执行MiraiConsole.cancel,否则会报错Mirai Console is already initialized and is currently running. Run MiraiConsole.cancel to kill old instance before starting another instance.。
java编写时,没有找到对应MiraiConsole.cancel的方法。
复现
Test基类:
public abstract class AbstractJConsoleTest {
MiraiConsoleImplementationTerminal consoleInstance;
@Before
public void initializeConsole() {
consoleInstance = new MiraiConsoleImplementationTerminal();
MiraiConsoleTerminalLoader.INSTANCE.startAsDaemon(consoleInstance);
}
@After
public void cancelConsole() {
// need something likes MiraiConsole.cancel in java :
// consoleInstance.cancel() or MiraiConsoleTerminalLoader.INSTANCE.cancelConsole()
}
}
具体Test类:
public class JConsoleTestA extends AbstractJConsoleTest {
@Test
public void test() {
// ……
}
}
public class JConsoleTestB extends AbstractJConsoleTest {
@Test
public void test() {
// ……
}
}
执行gradle test。JConsoleTestA ,JConsoleTestB 其中一个报错:Mirai Console is already initialized and is currently running. Run MiraiConsole.cancel to kill old instance before starting another instance.
mirai-core 版本
2.8.0
bot-protocol
ANDROID_PHONE
其他组件版本
No response
系统日志
Mirai Console is already initialized and is currently running. Run MiraiConsole.cancel to kill old instance before starting another instance.
java.lang.IllegalStateException: Mirai Console is already initialized and is currently running. Run MiraiConsole.cancel to kill old instance before starting another instance.
at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:269)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152)
网络日志
无
补充信息
No response
The text was updated successfully, but these errors were encountered:
问题描述
当gradle test运行多个Test时,要求每个Test结束时执行MiraiConsole.cancel,否则会报错
Mirai Console is already initialized and is currently running. Run MiraiConsole.cancel to kill old instance before starting another instance.
。java编写时,没有找到对应MiraiConsole.cancel的方法。
复现
Test基类:
具体Test类:
执行gradle test。JConsoleTestA ,JConsoleTestB 其中一个报错:
Mirai Console is already initialized and is currently running. Run MiraiConsole.cancel to kill old instance before starting another instance.
mirai-core 版本
2.8.0
bot-protocol
ANDROID_PHONE
其他组件版本
No response
系统日志
网络日志
补充信息
No response
The text was updated successfully, but these errors were encountered: