mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-06-02 06:24:16 +02:00
fix: clamp future lastHeard timestamps to current time on ingestion (#5418)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+1
-5
@@ -39,13 +39,11 @@ import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import kotlinx.coroutines.withTimeout
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertContentEquals
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertIs
|
||||
import kotlin.test.assertNotNull
|
||||
import kotlin.test.assertNull
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
@@ -206,13 +204,11 @@ class WifiOtaTransportTest {
|
||||
|
||||
@Test
|
||||
fun `close resets transport and closes TCP connection`() = runTest {
|
||||
val (transport, server, connection) = createConnectedTransport()
|
||||
val (transport, server, _) = createConnectedTransport()
|
||||
|
||||
try {
|
||||
transport.close()
|
||||
|
||||
assertNull(withTimeout(5_000L) { connection.readLine() })
|
||||
|
||||
val result = transport.startOta(1L, "hash")
|
||||
assertTrue(result.isFailure)
|
||||
assertIs<OtaProtocolException.ConnectionFailed>(result.exceptionOrNull())
|
||||
|
||||
Reference in New Issue
Block a user