Skip to content

Commit

Permalink
Skip tests that are expected to fail with timeouts (flutter#20074)
Browse files Browse the repository at this point in the history
* Skip tests instead of expecting failure, because expected failure = timeout which is slow

Some of these tests are known to fail and were coded to expect it; however because the failure is a timeout it's just dragging out test runs (shortening timeouts will make the tests flakier).

* Make it easier to find skipped tests

* Change SKIP to TODO
  • Loading branch information
DanTup authored Aug 1, 2018
1 parent c3248b7 commit 9370569
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ void main() {
testUsingContext('can hot reload', () async {
await _flutterRun.run(withDebugger: true);
await _flutterAttach.attach(_flutterRun.vmServicePort);

await _flutterAttach.hotReload();
});
// Skip on Windows due to https://github.com/flutter/flutter/issues/17833
// TODO(dantup): Unskip after https://github.com/flutter/flutter/issues/17833.
}, timeout: const Timeout.factor(3), skip: platform.isWindows);
}
42 changes: 10 additions & 32 deletions packages/flutter_tools/test/integration/hot_reload_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,19 @@ void main() {

test('works without error', () async {
await _flutter.run();

// Due to https://github.com/flutter/flutter/issues/17833 this will
// throw on Windows. If you merge a fix for this and this test starts failing
// because it didn't throw on Windows, you should delete the wrapping expect()
// and just `await` the hotReload directly
// (dantup)

await expectLater(
_flutter.hotReload(),
platform.isWindows ? throwsA(anything) : completes,
);
});
await _flutter.hotReload();
// TODO(dantup): Unskip after https://github.com/flutter/flutter/issues/17833.
}, skip: platform.isWindows);

test('hits breakpoints with file:// prefixes after reload', () async {
await _flutter.run(withDebugger: true);

// This test fails due to // https://github.com/flutter/flutter/issues/18441
// If you merge a fix for this and the test starts failing because it's not
// throwing, delete the wrapping expect/return below.
// (dantup)
//
// final VMIsolate isolate = await _flutter.breakAt(
// new Uri.file(_project.breakpointFile).toString(),
// _project.breakpointLine
// );
// expect(isolate.pauseEvent, const isInstanceOf<VMPauseBreakpointEvent>());
await expectLater(() async {
// Hit breakpoint using a file:// URI.
final VMIsolate isolate = await _flutter.breakAt(
new Uri.file(_project.breakpointFile).toString(),
_project.breakpointLine
);
expect(isolate.pauseEvent, const isInstanceOf<VMPauseBreakpointEvent>());
}(), platform.isLinux ? completes : throwsA(anything)
);
});
// Hit breakpoint using a file:// URI.
final VMIsolate isolate = await _flutter.breakAt(
new Uri.file(_project.breakpointFile).toString(),
_project.breakpointLine);
expect(isolate.pauseEvent, const isInstanceOf<VMPauseBreakpointEvent>());
// TODO(dantup): Unskip after https://github.com/flutter/flutter/issues/18441.
}, skip: !platform.isLinux);
}, timeout: const Timeout.factor(3));
}
2 changes: 1 addition & 1 deletion packages/flutter_tools/test/integration/lifetime_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ void main() {
await new Future<void>.delayed(requiredLifespan);
expect(_flutter.hasExited, equals(false));
});
// Skip on Windows due to https://github.com/flutter/flutter/issues/17833
// TODO(dantup): Unskip after https://github.com/flutter/flutter/issues/17833.
}, timeout: const Timeout.factor(3), skip: platform.isWindows);
}

0 comments on commit 9370569

Please sign in to comment.