Revert runTest because the wait to get results back fails in the function

This commit is contained in:
Vitor Pamplona
2025-11-21 17:16:08 -05:00
parent 382de9ba03
commit d12a8ba1c1
2 changed files with 4 additions and 4 deletions
@@ -103,7 +103,7 @@ suspend fun INostrClient.sendAndWaitForResponse(
val currentResult = receivedResults[result.relay]
// do not override a successful result.
if (currentResult == null || !currentResult) {
receivedResults.put(result.relay, result.success)
receivedResults[result.relay] = result.success
}
}
}
@@ -30,14 +30,14 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.runBlocking
import kotlin.test.Test
import kotlin.test.assertEquals
class NostrClientSendAndWaitTest : BaseNostrClientTest() {
@Test
fun testSendAndWaitForResponse() =
runTest {
runBlocking {
val appScope = CoroutineScope(Dispatchers.Default + SupervisorJob())
val client = NostrClient(socketBuilder, appScope)
@@ -61,6 +61,6 @@ class NostrClientSendAndWaitTest : BaseNostrClientTest() {
appScope.cancel()
assertEquals(true, resultDamus)
assertEquals(false, resultNos)
assertEquals(true, resultNos)
}
}