File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
misk-vitess/src/testFixtures/kotlin/misk/vitess/testing/internal Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,7 @@ internal class VitessDockerContainer(
7878 const val PORT_CHECK_TIMEOUT_MS = 200
7979
8080 // Used for synchronizing to prevent race-conditions.
81- val startContainerLock = Any ()
82- val removeContainerLock = Any ()
81+ val containerLock = Any () // Use the same mutex for both starting and removing containers.
8382 val vitessNetworkLock = Any ()
8483 }
8584
@@ -293,7 +292,7 @@ internal class VitessDockerContainer(
293292 * This method removes the container. If the container is already removed or being removed, it returns `false`.
294293 */
295294 private fun removeContainer (container : Container ): Boolean {
296- synchronized(removeContainerLock ) {
295+ synchronized(containerLock ) {
297296 try {
298297 dockerClient.removeContainerCmd(container.id).withForce(true ).exec()
299298 return true
@@ -308,7 +307,7 @@ internal class VitessDockerContainer(
308307 }
309308
310309 private fun startContainer (containerId : String ) {
311- synchronized(startContainerLock ) {
310+ synchronized(containerLock ) {
312311 try {
313312 // Check if the container is already running
314313 val containerInfo = dockerClient.inspectContainerCmd(containerId).exec()
You can’t perform that action at this time.
0 commit comments