def _are_services_running(self, services: Optional[List[str]] = None) -> bool:
        """Check if the specified services are already running.

        Args:
            services: List of services to check, or None to check all services

        Returns:
            True if all services are running, False otherwise
        """
        os.chdir(self.tests_dir)
        try:
            # Get list of running containers for this project
            cmd = [
                *self.compose_cmd,
                "-f",
                self.compose_file,
                "-p",
                DEFAULT_PROJECT_NAME,
                "ps",
                "-q",
            ]
            result = subprocess.run(cmd, capture_output=True, text=True, check=True)
            container_ids = [cid for cid in result.stdout.strip().split("\n") if cid]

            if not container_ids:
                return False

            # If no specific services were requested, just check if any containers are running
            if not services:
                return len(container_ids) > 0

            # Check if the specific services are running
            running_services = []
            for container_id in container_ids:
                inspect_cmd = [
                    "docker",
                    "inspect",
                    "--format",
                    "{{.Config.Labels.com.docker.compose.service}}",
                    container_id,
                ]
                service_result = subprocess.run(
                    inspect_cmd, capture_output=True, text=True, check=True
                )
                service_name = service_result.stdout.strip()
                running_services.append(service_name)

            # Check if all requested services are running
            return all(service in running_services for service in services)
        except Exception as e:
            logger.debug(f"Error checking if services are running: {e}")
            return False
        finally:
            os.chdir(self.cwd)
Check if the specified services are already running.

        Args:
            services: List of services to check, or None to check all services

        Returns:
            True if all services are running, False otherwise
        
backend/tests/helpers/docker.py