运行 gitlab 中的 Flutter Web 集成测试(可能 github 到)Ubuntu VM 由于 Chromedriver 而失败

Running Flutter Web integration tests inside gitlab (probably github too) Ubuntu VM fails because of Chromedriver

我正在尝试 运行 gitlab VM 中的 Web 集成测试。 虚拟机是 运行ning Ubuntu 20.04.3 LTS。 Chromedriver 使用此命令行启动:

chromedriver -port=4444 --enable-chrome-logs

来自 chrome 驱动程序输出的错误是:

[0131/212240.342700:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[0131/212240.347411:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[0131/212241.926360:INFO:CONSOLE(65)] "Installed new service worker.", source: http://localhost:8080/ (65)
[0131/212242.084358:ERROR:broker_posix.cc(46)] Received unexpected number of handles

将 chrome 97 或 97 与 chrome 驱动程序 97 或 98 一起使用会产生相同的错误。

使用此命令启动 Flutter 集成测试:

flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d web-server --headless

在进程中用多个线程调用的 InitializeSandbox() 是已知问题,可以使用标志 --disable-gpu 修复,但直到知道为止,我还没有找到任何解决方案从 Flutter CLI 或通过配置 FlutterDriver 禁用 gpu。

知道如何解决这个问题吗? 谢谢

必须将 --release 标志提供给命令行。 所以命令应该是这样的:

flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d web-server --release