mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-24 19:20:30 +08:00
Avoid killing JVM in Gradle tests
This commit is contained in:
parent
dc2b4d2b7b
commit
fffefbacef
@ -287,8 +287,13 @@ public interface MiraiConsoleImplementation : CoroutineScope {
|
||||
it.printStackTrace()
|
||||
}
|
||||
Thread.sleep(3000L) // 保证信息打印完成
|
||||
exitProcess(1)
|
||||
if (!IS_GRADLE_TEST) exitProcess(1)
|
||||
// For gradle tests, killing the JVM also kills a Gradle worker which cause './gradlew test' to fail.
|
||||
// See https://github.com/gradle/gradle/issues/11195 for more information.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmField
|
||||
internal var IS_GRADLE_TEST = false
|
@ -33,6 +33,7 @@ import kotlin.test.assertNotNull
|
||||
|
||||
@OptIn(ConsoleInternalApi::class, kotlin.io.path.ExperimentalPathApi::class)
|
||||
fun initTestEnvironment() {
|
||||
IS_GRADLE_TEST = true
|
||||
object : MiraiConsoleImplementation {
|
||||
override val rootPath: Path = createTempDirectory()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user