Skip to content

Commit 7a7b009

Browse files
committed
Reactive tests fixed for cancellation logic change
1 parent d82b3a9 commit 7a7b009

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

reactive/kotlinx-coroutines-reactive/src/test/kotlin/kotlinx/coroutines/experimental/reactive/PublisherBackpressureTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class PublisherBackpressureTest : TestBase() {
3636
try {
3737
send("C") // will suspend (no more requested)
3838
} finally {
39-
expect(13)
39+
expect(12)
4040
}
4141
expectUnreached()
4242
}
@@ -58,7 +58,7 @@ class PublisherBackpressureTest : TestBase() {
5858
}
5959

6060
override fun onComplete() {
61-
expect(11)
61+
expect(13)
6262
}
6363

6464
override fun onError(e: Throwable) {
@@ -68,9 +68,9 @@ class PublisherBackpressureTest : TestBase() {
6868
expect(4)
6969
yield() // yield to observable coroutine
7070
expect(10)
71-
sub!!.cancel() // now unsubscribe -- shall cancel coroutine & invoke onCompleted
72-
expect(12)
73-
yield() // shall perform finally in coroutine
71+
sub!!.cancel() // now unsubscribe -- shall cancel coroutine
72+
expect(11)
73+
yield() // shall perform finally in coroutine & report onComplete
7474
finish(14)
7575
}
7676
}

reactive/kotlinx-coroutines-rx1/src/test/kotlin/kotlinx/coroutines/experimental/rx1/ObservableBackpressureTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ObservableBackpressureTest : TestBase() {
3535
try {
3636
send("C") // will suspend (no more requested)
3737
} finally {
38-
expect(13)
38+
expect(12)
3939
}
4040
expectUnreached()
4141
}
@@ -55,7 +55,7 @@ class ObservableBackpressureTest : TestBase() {
5555
}
5656

5757
override fun onCompleted() {
58-
expect(11)
58+
expect(13)
5959
}
6060

6161
override fun onError(e: Throwable) {
@@ -65,9 +65,9 @@ class ObservableBackpressureTest : TestBase() {
6565
expect(4)
6666
yield() // yield to observable coroutine
6767
expect(10)
68-
sub.unsubscribe() // now unsubscribe -- shall cancel coroutine & invoke onCompleted
69-
expect(12)
70-
yield() // shall perform finally in coroutine
68+
sub.unsubscribe() // now unsubscribe -- shall cancel coroutine
69+
expect(11)
70+
yield() // shall perform finally in coroutine & invoke onCompleted
7171
finish(14)
7272
}
7373
}

0 commit comments

Comments
 (0)