Skip to content

dart fix --fail-fast runs full loops to complete #57118

@FMorschel

Description

@FMorschel

For the following code, we have 100 runs for Test $i. Even with --fail-fast the full loops are completed before the test stops. Can this be fixed so that if a test fails (with --fail-fast) it works as a break in all loops or something?

Repro:

import 'package:test/test.dart';

void main() {
  group('Tests', () {
    for (var i = 0; i < 100; i++) {
      group('Tests J $i', () {
        for (var j = 0; j < 100; j++) {
          print('Test $i - $j');
          test('Test $i', () {
            expect(i, 1);
            expect(j, 1);
          });
        }
      });
    }
  });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-testCross-cutting test issues (use area- labels for specific failures; not used for package:test).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions