Fix SelectorRecoveryTest

This commit is contained in:
Him188 2022-06-08 20:31:29 +01:00
parent 7999aa2aea
commit 802ab56311
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -22,6 +22,7 @@ import net.mamoe.mirai.internal.test.runBlockingUnit
import net.mamoe.mirai.utils.TestOnly
import kotlin.test.Test
import kotlin.test.assertFails
import kotlin.test.assertTrue
/**
* Test whether the selector can recover the connection after first successful login.
@ -55,7 +56,7 @@ internal class SelectorRecoveryTest : AbstractCommonNHTestWithSelector() {
bot.components[EventDispatcher].joinBroadcast() // Wait our async connector to complete.
// BotOfflineMonitor immediately launches a recovery which is UNDISPATCHED, so connection is immediately recovered.
assertState(NetworkHandler.State.CONNECTING, NetworkHandler.State.LOADING, NetworkHandler.State.OK)
assertTrue { bot.network.state != NetworkHandler.State.CLOSED }
}
@Test