anchor.diff:    exit(1);
   }
   
  -// Pubsub messages must be < 10MB long.  Because the JSON we send is
  -// Base64 encoded, and we add a final record after checking the size,
  -// the limit must be less than 3/4 of 10MB.
  -// Because we have some Firestore scalability issues when thousands of new
  -// tests are added, we currently use less than half of the maximum size.
  -const messageLengthLimit = 3000000;
  +const resultsPerMessage = 100;
   const postUrl =
       'https://pubsub.googleapis.com/v1/projects/dart-ci/topics/results:publish';
   
  
positive.code:   final lines = await File(options['result_file']).readAsLines();
    final token = await File(options['auth_token']).readAsString();
    final buildbucketID = options['id'];
    // Construct pubsub messages.
    var line = 0;
    var numMessages = 0;
    while (line < lines.length) {
      final message = StringBuffer();
      message.write('[');
      message.write(lines[line++]);
      var messageLines = 1;
      while (message.length < messageLengthLimit && line < lines.length) {
        message.write(',\n');
        message.write(lines[line++]);
        messageLines++;
      }
      message.write(']');
      numMessages++;
      final attributes = {
        if (line == lines.length) 'num_chunks': numMessages.toString(),
        if (buildbucketID != null) 'buildbucket_id': buildbucketID
      };
      var base64data = base64Encode(utf8.encode(message.toString()));
      var messageObject = {
        'messages': [
          {'attributes': attributes, 'data': base64data}
        ]
      };
      var jsonMessage = jsonEncode(messageObject);
      var headers = {'Authorization': 'Bearer $token'};
      var response =
          await client.post(postUrl, headers: headers, body: jsonMessage);
      print('Sent pubsub message containing ${messageLines} results');
      print('Status ${response.statusCode}');
      print('Response: ${response.body}');
    }
    print('Number of Pub/Sub messages sent: $numMessages');
    client.close();
  }
  
negative.code: // 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.
  
  // Post results from Dart tryjobs and CI builders to Cloud Pub/Sub.
  //
  // Reads a results.json input file, sends only the changed results from
  // that file to the Pub/Sub channel 'results' in the 'dart-ci' project.
  // Multiple messages are sent if there are more than 100 changed results,
  // so the cloud function only needs to process 100 records within its time
  // limit of 60s. Because of this, we never approach the limit of 10 MB
  // base64-encoded data bytes per message.
  //
  // The function also scans results.json to find the configurations tested
  // by this builder, and writes them and a results feed URL filtered to
  // those configuration groups to a json file, used later in the recipe.
  
  import 'dart:convert';
  import 'dart:io';
  