Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: pkg/scheduled_test/lib/scheduled_test.dart

Issue 12218102: Add built-in timeouts to scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/schedule.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/scheduled_test.dart
diff --git a/pkg/scheduled_test/lib/scheduled_test.dart b/pkg/scheduled_test/lib/scheduled_test.dart
index 26a67323278590255e5277095d9d2c0123e47fdf..dfb2c8a9feb2ca7787f4e56fe1ffee93d800ff69 100644
--- a/pkg/scheduled_test/lib/scheduled_test.dart
+++ b/pkg/scheduled_test/lib/scheduled_test.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// TODO(nweiz): Add timeouts to scheduled tests.
// TODO(nweiz): Add support for calling [schedule] while the schedule is already
// running.
// TODO(nweiz): Port the non-Pub-specific scheduled test libraries from Pub.
@@ -139,6 +138,19 @@
/// schedule(() => sendRequest('payload'));
/// });
/// }
+///
+/// ## Timeouts
+///
+/// `scheduled_test` has a built-in timeout of 30 seconds (configurable via
+/// [Schedule.timeoutMs]). This timeout is aware of the structure of the
+/// schedule; this means that it will reset for each task in a queue, when
+/// moving between queues, or almost any other sort of interaction with
+/// [currentSchedule]. As long as the [Schedule] knows your test is making some
+/// sort of progress, it won't time out.
+///
+/// If a single task might take a long time, you can also manually tell the
+/// [Schedule] that it's making progress by calling [Schedule.heartbeat], which
+/// will reset the timeout whenever it's called.
library scheduled_test;
import 'dart:async';
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/schedule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698