Skip to content

tearDown is not called if a test times out #897

@itsjoeconway

Description

@itsjoeconway

Ran into this issue in particular when the current working directory was being manipulated in the test, and restored in tearDown.

Repro:

import 'dart:async';

import 'package:test/test.dart';

void main() {
  tearDown(() {
    print("tearDown");
  });

  test("test", () async {
    await new Future.delayed(Duration(seconds: 5));
  }, timeout: new Timeout(Duration(seconds: 1)));
}

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