Skip to content

Flaky CI: analyze_and_test (windows-latest) intermittently fails on `dart analyze --fatal-infos #144

Description

@reidbaker

The analyze_and_test job intermittently fails on windows-latest only, at the dart analyze --fatal-infos step. The same commit passes on ubuntu-latest and macos-latest, and dart analyze --fatal-infos is clean locally. This blocks PRs on a non-deterministic, environment-specific failure.

Affected workflow

Symptom

The step reports dart_code_linter plugin warnings against pre-existing test files, and each warning is emitted twice. With --fatal-infos, these become fatal. Examples:

warning - test\absolute_paths_test.dart:19:5 - Avoid using 'late' keyword. - avoid-late-keyword
warning - test\absolute_paths_test.dart:19:5 - Avoid using 'late' keyword. - avoid-late-keyword
warning - test\custom_rule_test.dart:7:7 - File name does not match with first class name. - prefer-match-file-name
warning - test\directory_structure_test.dart:29:3 - Avoid using dynamic type. - avoid-dynamic

Evidence it's environmental, not a code defect

  • Same commit: ubuntu-latest and macos-latest pass; only windows-latest fails.
  • dart analyze --fatal-infos is clean on local macOS.
  • Earlier commits on the same branch passed analyze_and_test (windows-latest).
  • The diagnostics are duplicated — a known artifact of the analyzer plugin double-reporting.

Suspected root cause

analysis_options.yaml registers dart_code_linter as an analyzer plugin, so its rules are surfaced through dart analyze (in addition to the dedicated dart run dart_code_linter:metrics analyze lib step). The plugin appears to load/report non-deterministically on Windows, intermittently emitting (and duplicating) these warnings, which --fatal-infos then treats as fatal.

Suggested directions (for maintainers to evaluate)

  • Rely on the dedicated dart run dart_code_linter:metrics analyze lib step for these rules and drop the dart_code_linter analyzer-plugin registration from analysis_options.yaml, so dart analyze only enforces core lints. OR
  • Exclude test/** from the dart_code_linter rules (these warnings are all in test files). OR
  • Pin/upgrade dart_code_linter (currently ^4.0.3) if a fixed version addresses the duplicate/non-deterministic reporting.

Environment

  • Dart SDK: stable (via dart-lang/setup-dart@v1)
  • analyzer 12.1.0, dart_code_linter ^4.0.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions