Skip to content
Snippets Groups Projects
Commit d7632a22 authored by Natalie Weizenbaum's avatar Natalie Weizenbaum
Browse files

Fix tests that use a 0-length timeout.

Our infrastructure changed such that synchronous or microtask-only test
bodies run before the timeout fires, so we need to have those tests wait
for a timer event.

R=kevmoo@google.com

Review URL: https://codereview.chromium.org//1654183003 .
parent 0c94f605
No related branches found
No related tags found
No related merge requests found
......@@ -241,12 +241,16 @@ void main() {
test("disables timeouts", () {
d.file("test.dart", """
import 'dart:async';
import 'package:test/test.dart';
void main() {
print('loaded test 1!');
test("success", () {}, timeout: new Timeout(Duration.ZERO));
test("success", () async {
await new Future.delayed(Duration.ZERO);
}, timeout: new Timeout(Duration.ZERO));
}
""").create();
......
......@@ -410,8 +410,11 @@ import 'dart:async';
import 'package:test/test.dart';
void main() {
test("fail", () => throw 'oh no', onPlatform: {
"vm": new Timeout(new Duration(seconds: 0))
test("fail", () async {
await new Future.delayed(Duration.ZERO);
throw 'oh no';
}, onPlatform: {
"vm": new Timeout(Duration.ZERO)
});
}
''').create();
......@@ -517,7 +520,10 @@ import 'dart:async';
import 'package:test/test.dart';
void main() {
test("fail", () => throw 'oh no');
test("fail", () async {
await new Future.delayed(Duration.ZERO);
throw 'oh no';
});
}
''').create();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment