Skip to content

Commit 6755ff9

Browse files
committed
More timeouts
1 parent ca18a49 commit 6755ff9

File tree

8 files changed

+16
-8
lines changed

8 files changed

+16
-8
lines changed

firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
package dev.gitlive.firebase
66

77
import kotlinx.coroutines.test.runTest
8+
import kotlin.time.Duration.Companion.minutes
89

910
actual val context: Any = Unit
1011

1112
actual fun runTest(test: suspend () -> Unit) {
12-
runTest { test() }
13+
runTest(timeout = 5.minutes) { test() }
1314
}
1415

1516
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)

firebase-auth/karma.config.d/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
config.set({
33
client: {
44
mocha: {
5-
timeout: 5000
5+
timeout: 180000
66
}
77
},
88
});

firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
package dev.gitlive.firebase.auth
66

7+
import kotlin.time.Duration.Companion.minutes
8+
79

810
actual val emulatorHost: String = "localhost"
911

1012
actual val context: Any = Unit
1113

12-
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() }
14+
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() }
1315

1416
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
1517
actual annotation class IgnoreForAndroidUnitTest
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package dev.gitlive.firebase.remoteconfig
22

3+
import kotlin.time.Duration.Companion.minutes
4+
35

46
actual val context: Any = Unit
57

6-
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() }
8+
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() }
79

810
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
911
actual annotation class IgnoreForAndroidUnitTest

firebase-database/karma.config.d/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
config.set({
33
client: {
44
mocha: {
5-
timeout: 5000
5+
timeout: 180000
66
}
77
},
88
});

firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import kotlinx.coroutines.Dispatchers
88
import kotlinx.coroutines.flow.first
99
import kotlinx.coroutines.withContext
1010
import kotlinx.coroutines.withTimeout
11+
import kotlin.time.Duration.Companion.minutes
1112
import kotlin.time.Duration.Companion.seconds
1213

1314
actual val emulatorHost: String = "127.0.0.1" // in JS tests connection is refused if we use localhost
1415

1516
actual val context: Any = Unit
16-
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest {
17+
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) {
1718
// in JS tests we need to wait for the database to be connected
1819
awaitDatabaseConnection()
1920
test()

firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import dev.gitlive.firebase.apps
1010
import dev.gitlive.firebase.initialize
1111
import kotlinx.coroutines.CoroutineScope
1212
import kotlin.test.*
13+
import kotlin.time.Duration.Companion.minutes
1314

1415
actual val emulatorHost: String = "localhost"
1516

1617
actual val context: Any = Unit
1718

18-
actual fun runTest(test: suspend CoroutineScope.() -> Unit) = kotlinx.coroutines.test.runTest { test() }
19+
actual fun runTest(test: suspend CoroutineScope.() -> Unit) = kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() }
1920

2021
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
2122
actual annotation class IgnoreForAndroidUnitTest

firebase-storage/src/jsTest/kotlin/dev/gitlive/firebase/storage/storage.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
package dev.gitlive.firebase.storage
66

77
import kotlinx.coroutines.CoroutineScope
8+
import kotlin.time.Duration.Companion.minutes
89

910
actual val emulatorHost: String = "127.0.0.1"
1011

1112
actual val context: Any = Unit
1213

1314
actual fun runTest(test: suspend CoroutineScope.() -> Unit) {
14-
kotlinx.coroutines.test.runTest { test() }
15+
kotlinx.coroutines.test.runTest(timeout = 5.minutes) { test() }
1516
}
1617

1718
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)

0 commit comments

Comments
 (0)