Skip to content

Commit 619c026

Browse files
Spotless
1 parent e922ae0 commit 619c026

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

stream-android-core/src/test/java/io/getstream/android/core/internal/processing/StreamSingleFlightProcessorImplTest.kt

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import io.mockk.coVerify
2222
import io.mockk.mockk
2323
import java.util.concurrent.ConcurrentHashMap
2424
import java.util.concurrent.ConcurrentMap
25+
import java.util.concurrent.Executors
2526
import kotlin.test.assertFailsWith
2627
import kotlin.test.assertFalse
2728
import kotlinx.coroutines.CancellationException
2829
import kotlinx.coroutines.CompletableDeferred
2930
import kotlinx.coroutines.CoroutineScope
3031
import kotlinx.coroutines.Deferred
31-
import kotlinx.coroutines.Dispatchers
3232
import kotlinx.coroutines.ExperimentalCoroutinesApi
3333
import kotlinx.coroutines.SupervisorJob
3434
import kotlinx.coroutines.asCoroutineDispatcher
@@ -42,7 +42,6 @@ import kotlinx.coroutines.test.runTest
4242
import org.junit.Assert.assertEquals
4343
import org.junit.Assert.assertTrue
4444
import org.junit.Test
45-
import java.util.concurrent.Executors
4645

4746
@OptIn(ExperimentalCoroutinesApi::class)
4847
class StreamSingleFlightProcessorImplTest {
@@ -423,28 +422,31 @@ class StreamSingleFlightProcessorImplTest {
423422
val pool = Executors.newFixedThreadPool(4).asCoroutineDispatcher()
424423
try {
425424
val map = RecordingMap<Any, Deferred<Result<*>>>()
426-
val sf = StreamSingleFlightProcessorImpl(
427-
scope = CoroutineScope(SupervisorJob() + pool),
428-
flights = map,
429-
)
425+
val sf =
426+
StreamSingleFlightProcessorImpl(
427+
scope = CoroutineScope(SupervisorJob() + pool),
428+
flights = map,
429+
)
430430
val key = "k".asStreamTypedKey<Int>()
431431

432432
repeat(200) { // more attempts to guarantee at least one race
433433
val gate = java.util.concurrent.CountDownLatch(1)
434-
val a = async(pool) {
435-
gate.await()
436-
sf.run(key) {
437-
delay(100) // keep the winner running long enough
438-
1
434+
val a =
435+
async(pool) {
436+
gate.await()
437+
sf.run(key) {
438+
delay(100) // keep the winner running long enough
439+
1
440+
}
439441
}
440-
}
441-
val b = async(pool) {
442-
gate.await()
443-
sf.run(key) {
444-
delay(100)
445-
1
442+
val b =
443+
async(pool) {
444+
gate.await()
445+
sf.run(key) {
446+
delay(100)
447+
1
448+
}
446449
}
447-
}
448450
gate.countDown()
449451
a.await()
450452
b.await()

0 commit comments

Comments
 (0)