anchor.diff:              var parts = makeParts(bytes, splits);
   
               // Simulation of our server
  -            var expectations = buildExpectations(bytes, chunkSize, false);
  +            var expectations = buildExpectations(
  +                bytes, chunkSize, false,
  +                numberOfServerErrors: numberOfServerErrors);
  +            // If the server simulates 50X errors and the client resumes only
  +            // a limited amount of time, we'll trunkate the number of requests
  +            // the server expects.
  +            // [The client will give up and if the server expects more, the test
  +            //  would timeout.]
  +            if (expectedErrorStatus != null) {
  +              expectations = expectations.sublist(0, messagesNrOfFailure);
  +            }
               httpMock.register(
                   expectAsync(serverRequestValidator(expectations),
                               count: expectations.length),
  
positive.code:               var firstRange =
                    'bytes=0-${end-1}';
  
                expectations.add({
                  'url' : 'http://upload.com/',
                  'method' : 'PUT',
                  'data' : sublist,
                  'headers' : {
                    'content-length' : '${sublist.length}',
                    'content-range' : firstContentRange,
                    'content-type' : 'foobar',
                  },
                  'response' : emptyResponse(
                      isLast ? 200 : 308,
                      new HeadersImpl(
                          isLast ? {
                            'content-type' : ['application/json; charset=utf-8'],
                          } : {
                            'range' : [firstRange],
                          }),
                      '')
                });
              }
              return expectations;
            }
  
negative.code:                      256*1024+1,
                       1024*1024-1,
                       1024*1024], true);
            });
  
            test('stream-big-block-parts--with-server-error-recovery', () {
              var options = new ResumableUploadOptions(
                  chunkSize: 256 * 1024, numberOfAttempts: 4);
              runTest(1, 1024 * 1024,
                      [1,
                       256*1024-1,
                       256*1024,
                       256*1024+1,
                       1024*1024-1,
                       1024*1024],
                       true,
                       numberOfServerErrors: 3,
                       resumableOptions: options);
            });
  
            test('stream-big-block-parts--server-error', () {
              var options = new ResumableUploadOptions(
                  chunkSize: 256 * 1024, numberOfAttempts: 3);
              runTest(1, 1024 * 1024,
                      [1,
                       256*1024-1,
                       256*1024,
                       256*1024+1,
                       1024*1024-1,
                       1024*1024],
                       true,
                       numberOfServerErrors: 3,
                       resumableOptions: options,
                       expectedErrorStatus: 503,
                       messagesNrOfFailure: 4);
            });
          });
        });
  