| Index: pkg/scheduled_test/test/scheduled_server_test.dart
|
| diff --git a/pkg/scheduled_test/test/scheduled_server_test.dart b/pkg/scheduled_test/test/scheduled_server_test.dart
|
| index 5fc78120a3866f592ca33b2f4bb61d4d88370936..aeb654f9a7e34503587aaf23b51e3f0db8100b52 100644
|
| --- a/pkg/scheduled_test/test/scheduled_server_test.dart
|
| +++ b/pkg/scheduled_test/test/scheduled_server_test.dart
|
| @@ -35,10 +35,18 @@ void main() {
|
|
|
| test('test 2', () {
|
| expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
|
| - expect(errors.length, equals(2));
|
| + // TODO(nweiz): There can be three errors due to issue 9151. The
|
| + // HttpParserException is reported without a stack trace, and so when it's
|
| + // wrapped twice it registers as a different exception each time (because
|
| + // it's given an ad-hoc stack trace). Always expect two exceptions when
|
| + // issue 9151 is fixed.
|
| + expect(errors.length, inInclusiveRange(2, 3));
|
| expect(errors[0].error, equals("'scheduled server 0' received GET /hello "
|
| "when no more requests were expected."));
|
| expect(errors[1].error, new isInstanceOf<HttpParserException>());
|
| + if (errors.length > 2) {
|
| + expect(errors[2].error, new isInstanceOf<HttpParserException>());
|
| + }
|
| });
|
| }, passing: ['test 2']);
|
|
|
| @@ -99,11 +107,19 @@ void main() {
|
| });
|
|
|
| test('test 2', () {
|
| - expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
|
| - expect(errors.length, equals(2));
|
| + // TODO(nweiz): There can be three errors due to issue 9151. The
|
| + // HttpParserException is reported without a stack trace, and so when it's
|
| + // wrapped twice it registers as a different exception each time (because
|
| + // it's given an ad-hoc stack trace). Always expect two exceptions when
|
| + // issue 9151 is fixed.
|
| + expect(errors.length, inInclusiveRange(2, 3));
|
| expect(errors[0].error, equals("'scheduled server 0' received GET /hello "
|
| "earlier than expected."));
|
| expect(errors[1].error, new isInstanceOf<HttpParserException>());
|
| + if (errors.length > 2) {
|
| + expect(errors[2].error, new isInstanceOf<HttpParserException>());
|
| + }
|
| + expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
|
| });
|
| }, passing: ['test 2']);
|
|
|
| @@ -147,11 +163,18 @@ void main() {
|
| });
|
|
|
| test('test 2', () {
|
| - expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
|
| - expect(errors.length, equals(2));
|
| + // TODO(nweiz): There can be three errors due to issue 9151. The
|
| + // HttpParserException is reported without a stack trace, and so when it's
|
| + // wrapped twice it registers as a different exception each time (because
|
| + // it's given an ad-hoc stack trace). Always expect two exceptions when
|
| + // issue 9151 is fixed.
|
| + expect(errors.length, inInclusiveRange(2, 3));
|
| expect(errors[0].error, equals("'scheduled server 0' expected GET "
|
| "/goodbye, but got GET /hello."));
|
| expect(errors[1].error, new isInstanceOf<HttpParserException>());
|
| + if (errors.length > 2) {
|
| + expect(errors[2].error, new isInstanceOf<HttpParserException>());
|
| + }
|
| });
|
| }, passing: ['test 2']);
|
|
|
| @@ -173,11 +196,18 @@ void main() {
|
| });
|
|
|
| test('test 2', () {
|
| - expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
|
| - expect(errors.length, equals(2));
|
| + // TODO(nweiz): There can be three errors due to issue 9151. The
|
| + // HttpParserException is reported without a stack trace, and so when it's
|
| + // wrapped twice it registers as a different exception each time (because
|
| + // it's given an ad-hoc stack trace). Always expect two exceptions when
|
| + // issue 9151 is fixed.
|
| + expect(errors.length, inInclusiveRange(2, 3));
|
| expect(errors[0].error, equals("'scheduled server 0' expected GET "
|
| "/hello, but got HEAD /hello."));
|
| expect(errors[1].error, new isInstanceOf<HttpParserException>());
|
| + if (errors.length > 2) {
|
| + expect(errors[2].error, new isInstanceOf<HttpParserException>());
|
| + }
|
| });
|
| }, passing: ['test 2']);
|
|
|
| @@ -271,11 +301,18 @@ void main() {
|
| });
|
|
|
| test('test 2', () {
|
| - expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
|
| - expect(errors.length, equals(2));
|
| + // TODO(nweiz): There can be three errors due to issue 9151. The
|
| + // HttpParserException is reported without a stack trace, and so when it's
|
| + // wrapped twice it registers as a different exception each time (because
|
| + // it's given an ad-hoc stack trace). Always expect two exceptions when
|
| + // issue 9151 is fixed.
|
| + expect(errors.length, inInclusiveRange(2, 3));
|
| expect(errors[0].error, equals("'scheduled server 0' received GET "
|
| "/hello/3 when no more requests were expected."));
|
| expect(errors[1].error, new isInstanceOf<HttpParserException>());
|
| + if (errors.length > 2) {
|
| + expect(errors[2].error, new isInstanceOf<HttpParserException>());
|
| + }
|
| });
|
| }, passing: ['test 2']);
|
|
|
| @@ -296,10 +333,17 @@ void main() {
|
| });
|
|
|
| test('test 2', () {
|
| - expect(errors, everyElement(new isInstanceOf<ScheduleError>()));
|
| - expect(errors.length, equals(2));
|
| + // TODO(nweiz): There can be three errors due to issue 9151. The
|
| + // HttpParserException is reported without a stack trace, and so when it's
|
| + // wrapped twice it registers as a different exception each time (because
|
| + // it's given an ad-hoc stack trace). Always expect two exceptions when
|
| + // issue 9151 is fixed.
|
| + expect(errors.length, inInclusiveRange(2, 3));
|
| expect(errors[0].error, equals('oh no'));
|
| expect(errors[1].error, new isInstanceOf<HttpParserException>());
|
| + if (errors.length > 2) {
|
| + expect(errors[2].error, new isInstanceOf<HttpParserException>());
|
| + }
|
| });
|
| }, passing: ['test 2']);
|
| }
|
|
|