| Index: pkg/scheduled_test/lib/src/schedule.dart
|
| diff --git a/pkg/scheduled_test/lib/src/schedule.dart b/pkg/scheduled_test/lib/src/schedule.dart
|
| index 88c26eb1539421ce86b6caa09a822d3d6d4b78bb..451c994569ed5aad70dd5db106aa5b7dcb5cbb59 100644
|
| --- a/pkg/scheduled_test/lib/src/schedule.dart
|
| +++ b/pkg/scheduled_test/lib/src/schedule.dart
|
| @@ -12,6 +12,7 @@ import 'package:unittest/unittest.dart' as unittest;
|
|
|
| import 'mock_clock.dart' as mock_clock;
|
| import 'schedule_error.dart';
|
| +import '../scheduled_test.dart' show captureStackTraces;
|
| import 'substitute_future.dart';
|
| import 'task.dart';
|
| import 'utils.dart';
|
| @@ -309,7 +310,7 @@ class Schedule {
|
| /// are no duplicate errors, and that all errors are wrapped in
|
| /// [ScheduleError].
|
| void _addError(error) {
|
| - if (errors.contains(error)) return;
|
| + if (error is ScheduleError && errors.contains(error)) return;
|
| errors.add(new ScheduleError.from(this, error));
|
| }
|
| }
|
| @@ -496,8 +497,12 @@ class TaskQueue {
|
| if (description == null) {
|
| description = "Out-of-band operation #${_totalCallbacks}";
|
| }
|
| - var stackString = prefixLines(terseTraceString(new Trace.current()));
|
| - description = "$description\n\nStack trace:\n$stackString";
|
| +
|
| + if (captureStackTraces) {
|
| + var stackString = prefixLines(terseTraceString(new Trace.current()));
|
| + description += "\n\nStack trace:\n$stackString";
|
| + }
|
| +
|
| _totalCallbacks++;
|
|
|
| _pendingCallbacks.add(description);
|
|
|