You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何远程调试Docker容器内运行的Flutter测试

Docker容器内Flutter测试超时,寻求远程调试方法

问题概述

我参照《Reduce your CI cost using Docker to run local tests》一文,在Ubuntu Docker容器中成功运行Flutter测试,但其中一个测试运行约10分钟后超时失败,报错信息如下:

# flutter test test/lib/mobile/services/sync/sync_service_test.dart
12:25 +0 -1: apiSync It should throw an exception if the sync fails [E]
  TimeoutException after 0:10:00.000000: Test timed out after 10 minutes.
  dart:isolate  _RawReceivePortImpl._handleMessage

该测试在我的macOS本地机器及Bitrise CI上均可正常执行。我现在需要的是远程调试容器内该测试的方法,而非直接解决这个特定测试的超时问题。

修改后的Dockerfile

# Need to match the version of Linux your CI is running on
FROM ubuntu:20.04

# Prerequisites
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
RUN apt update && apt install -y curl git unzip xz-utils zip libglu1-mesa openjdk-8-jdk wget libsqlite3-dev

WORKDIR /home/developer

# Download Flutter SDK
ARG flutter_version
RUN git clone https://github.com/flutter/flutter.git -b ${flutter_version}
ENV PATH "$PATH:/home/developer/flutter/bin"

COPY pubspec.* /home/developer/project/

WORKDIR /home/developer/project

RUN flutter pub get

COPY *.yaml *.json /home/developer/project/
COPY android /home/developer/project/android
COPY assets /home/developer/project/assets
COPY doc /home/developer/project/doc
COPY docker /home/developer/project/docker
COPY ios /home/developer/project/ios
COPY lib /home/developer/project/lib
COPY macos /home/developer/project/macos
COPY scripts /home/developer/project/scripts
COPY test /home/developer/project/test
COPY test_environment /home/developer/project/test_environment
COPY tool /home/developer/project/tool
COPY web /home/developer/project/web

# Run basic check to download Dart SDK
RUN flutter doctor

需求

请说明在Docker容器内远程调试该Flutter测试的可行性及具体实现步骤,重点放在调试方法上,不用针对这个测试的超时问题给出解决方案。


内容的提问来源于stack exchange,提问作者Eranga Heshan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 17:30:57