File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
main/scala-2/com/couchbase/client/scala
test/scala/com/couchbase/client/scala Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,14 @@ class AsyncCluster(
308
308
def disconnect (timeout : Duration = env.timeoutConfig.disconnectTimeout()): Future [Unit ] = {
309
309
FutureConversions
310
310
.javaMonoToScalaFuture(couchbaseOps.shutdown(timeout))
311
- .map(_ => if (env.owned) env.shutdown(timeout))
311
+ .flatMap(_ =>
312
+ if (env.owned) {
313
+ // Explicitly put this on the global threadpool, otherwise it will execute on the
314
+ // threadpool we are shutting down due to the implicit `ec` in scope.
315
+ Future (env.shutdown(timeout))(scala.concurrent.ExecutionContext .global)
316
+ } else
317
+ Future .successful(())
318
+ )
312
319
}
313
320
314
321
/** Returns a `DiagnosticsResult`, reflecting the SDK's current view of all its existing connections to the
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package com.couchbase.client.scala
2
2
3
3
import com .couchbase .client .core .env .WanDevelopmentProfile
4
4
import com .couchbase .client .scala .env ._
5
- import org .junit .jupiter .api .Test
5
+ import org .junit .jupiter .api .{ RepeatedTest , Test }
6
6
7
7
import scala .concurrent .duration .{Duration , _ }
8
8
import scala .util .{Success , Try }
@@ -144,7 +144,8 @@ class EnvironmentSpec {
144
144
}
145
145
}
146
146
147
- @ Test
147
+ // Repeated as this has been an intermittent failure in the past
148
+ @ RepeatedTest (10 )
148
149
def closeOwnedEnvironment (): Unit = {
149
150
val clusterTry : Try [Cluster ] = Cluster .connect(" 1.2.3.4" , " username" , " password" )
150
151
You can’t perform that action at this time.
0 commit comments