File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
jetbrains-core/tst/software/aws/toolkits/jetbrains/core Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ import com.intellij.openapi.application.ApplicationManager
7
7
import com.intellij.testFramework.ProjectRule
8
8
import com.intellij.testFramework.RuleChain
9
9
import kotlinx.coroutines.ExperimentalCoroutinesApi
10
+ import kotlinx.coroutines.delay
10
11
import kotlinx.coroutines.runBlocking
12
+ import kotlinx.coroutines.test.runBlockingTest
11
13
import org.assertj.core.api.Assertions.assertThat
12
14
import org.assertj.core.api.Assertions.assertThatThrownBy
13
15
import org.junit.Before
@@ -485,7 +487,11 @@ class AwsResourceCacheTest {
485
487
fun concurrentlyRunningExceptionalResourcesGetTheSameException () {
486
488
val latch = CountDownLatch (1 )
487
489
whenever(mockResource.fetch(any(), any())).then {
488
- latch.await(500 , TimeUnit .MILLISECONDS )
490
+ latch.await()
491
+ // exception gets thrown fast enough where the second fetchIfNeeded check occurs after the first call throws
492
+ runBlockingTest {
493
+ delay(500 )
494
+ }
489
495
throw RuntimeException (" Boom" )
490
496
}
491
497
You can’t perform that action at this time.
0 commit comments