File tree 1 file changed +3
-17
lines changed
kotlinx-coroutines-core/common/test/flow/operators
1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ class TimeoutTest : TestBase() {
154
154
}
155
155
156
156
@Test
157
- fun testUpstreamTimeoutIsolatedContext () = runTest {
157
+ fun testUpstreamTimeoutIsolatedContext () = withVirtualTime {
158
158
val flow = flow {
159
159
assertEquals(" upstream" , NamedDispatchers .name())
160
160
expect(1 )
@@ -169,7 +169,7 @@ class TimeoutTest : TestBase() {
169
169
}
170
170
171
171
@Test
172
- fun testUpstreamTimeoutActionIsolatedContext () = runTest {
172
+ fun testUpstreamTimeoutActionIsolatedContext () = withVirtualTime {
173
173
val flow = flow {
174
174
assertEquals(" upstream" , NamedDispatchers .name())
175
175
expect(1 )
@@ -187,21 +187,7 @@ class TimeoutTest : TestBase() {
187
187
}
188
188
189
189
@Test
190
- fun testUpstreamNoTimeoutIsolatedContext () = runTest {
191
- val flow = flow {
192
- assertEquals(" upstream" , NamedDispatchers .name())
193
- expect(1 )
194
- emit(1 )
195
- expect(2 )
196
- delay(10 )
197
- }.flowOn(NamedDispatchers (" upstream" )).timeout(100 .milliseconds)
198
-
199
- assertEquals(listOf (1 ), flow.toList())
200
- finish(3 )
201
- }
202
-
203
- @Test
204
- fun testSharedFlowTimeout () = runTest {
190
+ fun testSharedFlowTimeout () = withVirtualTime {
205
191
// Workaround for JS legacy bug
206
192
try {
207
193
MutableSharedFlow <Int >().asSharedFlow().timeout(100 .milliseconds).collect()
You can’t perform that action at this time.
0 commit comments