Skip to content

Commit 9a2eb38

Browse files
committed
Add missing TestBase inheritance to fail on asynchronous errors
1 parent 1a2707b commit 9a2eb38

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

kotlinx-coroutines-core/jvm/test/internal/FastServiceLoaderTest.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package kotlinx.coroutines.internal
22

3-
import kotlinx.coroutines.CoroutineScope
4-
import kotlinx.coroutines.Delay
3+
import kotlinx.coroutines.*
54
import kotlin.test.*
65

7-
class FastServiceLoaderTest {
6+
class FastServiceLoaderTest : TestBase() {
87
@Test
98
fun testCrossModuleService() {
109
val providers = CoroutineScope::class.java.let { FastServiceLoader.loadProviders(it, it.classLoader) }

kotlinx-coroutines-core/jvm/test/internal/SegmentQueueTest.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package kotlinx.coroutines.internal
22

3-
import kotlinx.coroutines.stressTestMultiplier
3+
import kotlinx.coroutines.*
44
import org.junit.Test
55
import java.util.*
66
import java.util.concurrent.CyclicBarrier
@@ -9,9 +9,9 @@ import kotlin.concurrent.thread
99
import kotlin.random.Random
1010
import kotlin.test.assertEquals
1111

12-
class SegmentQueueTest {
12+
class SegmentQueueTest : TestBase() {
1313
@Test
14-
fun simpleTest() {
14+
fun testSimpleTest() {
1515
val q = SegmentBasedQueue<Int>()
1616
assertEquals(1, q.numberOfSegments)
1717
assertEquals(null, q.dequeue())
@@ -69,10 +69,10 @@ class SegmentQueueTest {
6969
}
7070

7171
@Test
72-
fun stressTestRemoveSegmentsSerial() = stressTestRemoveSegments(false)
72+
fun testRemoveSegmentsSerial() = stressTestRemoveSegments(false)
7373

7474
@Test
75-
fun stressTestRemoveSegmentsRandom() = stressTestRemoveSegments(true)
75+
fun testRemoveSegmentsRandom() = stressTestRemoveSegments(true)
7676

7777
private fun stressTestRemoveSegments(random: Boolean) {
7878
val N = 100_000 * stressTestMultiplier

reactive/kotlinx-coroutines-reactive/test/ReactiveStreamTckTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import org.testng.*
1111
import org.testng.annotations.*
1212

1313

14-
class ReactiveStreamTckTest {
14+
class ReactiveStreamTckTest : TestBase() {
1515

1616
@Factory(dataProvider = "dispatchers")
1717
fun createTests(dispatcher: Dispatcher): Array<Any> {

reactive/kotlinx-coroutines-reactor/test/FlowAsFluxTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package kotlinx.coroutines.reactor
22

3+
import kotlinx.coroutines.*
34
import kotlinx.coroutines.flow.*
45
import kotlinx.coroutines.reactive.*
5-
import kotlinx.coroutines.runBlocking
66
import org.junit.Test
77
import reactor.core.publisher.Mono
88
import reactor.util.context.Context
99
import kotlin.test.assertEquals
1010

11-
class FlowAsFluxTest {
11+
class FlowAsFluxTest : TestBase() {
1212
@Test
1313
fun testFlowToFluxContextPropagation() = runBlocking<Unit> {
1414
val flux = flow<String> {

reactive/kotlinx-coroutines-reactor/test/FluxSingleTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import org.junit.Assert.*
1111
import reactor.core.publisher.*
1212
import java.time.Duration.*
1313

14-
class FluxSingleTest {
14+
class FluxSingleTest : TestBase() {
1515
@Test
1616
fun testSingleNoWait() {
1717
val flux = flux {

reactive/kotlinx-coroutines-reactor/test/ReactorContextTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import reactor.core.publisher.*
99
import reactor.util.context.*
1010
import kotlin.test.*
1111

12-
class ReactorContextTest {
12+
class ReactorContextTest : TestBase() {
1313
@Test
1414
fun testMonoHookedContext() = runBlocking {
1515
val mono = mono(Context.of(1, "1", 7, "7").asCoroutineContext()) {

reactive/kotlinx-coroutines-rx2/test/ObservableSingleTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.junit.*
1010
import org.junit.Assert.*
1111
import java.util.concurrent.*
1212

13-
class ObservableSingleTest {
13+
class ObservableSingleTest : TestBase() {
1414
@Test
1515
fun testSingleNoWait() {
1616
val observable = rxObservable {

ui/kotlinx-coroutines-android/android-unit-tests/test/ordered/tests/CustomizedRobolectricTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class InitMainDispatcherBeforeRobolectricTestRunner(testClass: Class<*>) : Robol
2626

2727
@Config(manifest = Config.NONE, sdk = [28])
2828
@RunWith(InitMainDispatcherBeforeRobolectricTestRunner::class)
29-
class CustomizedRobolectricTest {
29+
class CustomizedRobolectricTest : TestBase() {
3030
@Test
3131
fun testComponent() {
3232
// Note that main is not set at all

ui/kotlinx-coroutines-android/test/R8ServiceLoaderOptimizationTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
package kotlinx.coroutines.android
66

7+
import kotlinx.coroutines.*
78
import org.jf.dexlib2.*
89
import org.junit.Test
910
import java.io.*
1011
import java.util.stream.*
1112
import kotlin.test.*
1213

13-
class R8ServiceLoaderOptimizationTest {
14+
class R8ServiceLoaderOptimizationTest : TestBase() {
1415
private val r8Dex = File(System.getProperty("dexPath")!!).asDexFile()
1516
private val r8DexNoOptim = File(System.getProperty("noOptimDexPath")!!).asDexFile()
1617

0 commit comments

Comments
 (0)