Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

web_compiler_test fails on LUCI in Dart SDK

Aberta Para iniciantes
#10,032 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
73/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
dart, flutter
Domínio
testing

Direção de pesquisa

Leia web_compiler_test.dart por volta das linhas 37–45 e compare as opções do Chrome com web_driver_service.dart por volta das linhas 361–369. Execute o teste webdriver que está falhando no LUCI ou em uma configuração headless comparável; o trabalho estará concluído quando o teste selecionar o renderizador skwasm esperado, em vez de recorrer ao canvaskit.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Recently devtools webdriver tests failed on LUCI in Dart SDK: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8668669452558670145/+/u/test_devtools/stdout?format=raw

Gemini had this to say:

Root Cause of the web_compiler_test.dart Failure on Windows

In web_compiler_test.dart:66-86, the test opens DevTools with ?compiler=wasm and checks that <body flt-renderer="..."> equals 'skwasm', but got 'canvaskit':

  1. When ?compiler=wasm is passed, flutter_bootstrap.js:116-125 calls _flutter.loader.load without forcing a renderer (rendererConfig = {}), letting Flutter's FlutterLoader pick the first compatible build from _flutter.buildConfig.builds (skwasm first, then canvaskit).

  2. FlutterLoader requires browserEnvironment.webGLVersion > 0 for skwasm (checked via canvas.getContext('webgl2') / canvas.getContext('webgl') in browser_environment.js:69-81), whereas canvaskit does not check webGLVersion > 0.

  3. web_compiler_test.dart:37-45 starts Chrome with only 'args': ['--headless']:

    driver = await createDriver(
      uri: Uri.parse('http://127.0.0.1:${ChromeDriver.port}'),
      desired: {
        ...Capabilities.chrome,
        Capabilities.chromeOptions: {
          'args': ['--headless'],
        },
      },
    );
    
  4. Starting in Chrome 139+ (LUCI uses Chrome 155), Chrome disabled automatic fallback to its bundled SwiftShader for WebGL on headless VMs without a hardware GPU unless --enable-unsafe-swiftshader is passed (which is why flutter_tools added SwiftShader flags when rolling Chrome 145+). On the GPU-less Windows LUCI VM, getContext('webgl2') returns null (webGLVersion == -1), causing FlutterLoader to reject the skwasm build and fall back to canvaskit.

Upstream Change Needed in flutter/devtools

In web_compiler_test.dart:37-45, pass the SwiftShader flags (and optionally CHROME_EXECUTABLE as 'binary') in Capabilities.chromeOptions, matching web_driver_service.dart:361-369:

    driver = await createDriver(
      uri: Uri.parse('http://127.0.0.1:${ChromeDriver.port}'),
      desired: {
        ...Capabilities.chrome,
        Capabilities.chromeOptions: {
          if (Platform.environment['CHROME_EXECUTABLE'] case final chromeExe?)
            'binary': chromeExe,
          'args': [
            '--headless',
            if (Platform.isLinux || Platform.isWindows) ...[
              '--use-gl=angle',
              '--use-angle=swiftshader',
              '--enable-unsafe-swiftshader',
              '--disable-gpu-sandbox',
            ],
          ],
        },
      },
    );

Do these words make sense to you, @kenzieschmoll ?

Linguagem predominante
Dart
Estrelas
1.7k
Forks
407
Merge médio
3d 14h
PRs com merge (30d)
15

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de flutter/devtools

Todas as issues de flutter/devtools

Issues semelhantes

Mais issues de Dart

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.