diff --git a/services/s3/common/src/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProvider.kt b/services/s3/common/src/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProvider.kt index da2e3fc1b0d..d8936f28a3b 100644 --- a/services/s3/common/src/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProvider.kt +++ b/services/s3/common/src/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProvider.kt @@ -68,7 +68,6 @@ internal class DefaultS3ExpressCredentialsProvider( } override fun close() { - runBlocking { coroutineContext.job.join() } coroutineContext.cancel(null) } diff --git a/services/s3/common/test/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProviderTest.kt b/services/s3/common/test/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProviderTest.kt index 78a9a05839b..989f5176259 100644 --- a/services/s3/common/test/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProviderTest.kt +++ b/services/s3/common/test/aws/sdk/kotlin/services/s3/express/DefaultS3ExpressCredentialsProviderTest.kt @@ -109,6 +109,7 @@ class DefaultS3ExpressCredentialsProviderTest { // allow the async refresh to initiate before closing the provider runBlocking { delay(50.milliseconds) } + provider.coroutineContext.job.join() provider.close() assertEquals(1, testClient.numCreateSession) } @@ -146,6 +147,7 @@ class DefaultS3ExpressCredentialsProviderTest { // allow the async refresh to initiate before closing the provider runBlocking { delay(50.milliseconds) } + provider.coroutineContext.job.join() provider.close() assertEquals(1, testClient.numCreateSession) } @@ -186,6 +188,7 @@ class DefaultS3ExpressCredentialsProviderTest { // allow the async refresh to initiate before closing the provider runBlocking { delay(50.milliseconds) } + provider.coroutineContext.job.join() provider.close() assertEquals(2, testClient.numCreateSession) }