Skip to content

Commit

Permalink
Try joining job in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis committed Mar 5, 2024
1 parent d50ef6c commit 7a8aeb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ internal class DefaultS3ExpressCredentialsProvider(
}

override fun close() {
runBlocking { coroutineContext.job.join() }
coroutineContext.cancel(null)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 7a8aeb5

Please sign in to comment.