anchor.diff:            ...options.rest,
           ],
           runInShell: Platform.isWindows);
  -
  +    // Wait for the downloads and the test run to complete.
  +    await Future.wait(tasks);
  +    // Merge the results and flaky data downloaded from the builders.
  +    final mergedResults = <String, Map<String, dynamic>>{};
  +    final mergedFlaky = <String, Map<String, dynamic>>{};
  +    if (needsMerge || needsConfigurationOverride) {
  +      for (int i = 0; i < downloadNumber; ++i) {
  +        previousFileName = needsMerge ? "previous-$i.json" : "previous.json";
  +        var results =
  +            await loadResultsMap("${outDirectory.path}/$previousFileName");
  +        if (needsConfigurationOverride) {
  +          overrideConfiguration(
  +              results, namedConfigurations.single, localConfiguration);
  +        }
  +        mergedResults.addAll(results);
  +        if (!options["report-flakes"]) {
  +          flakyFileName = needsMerge ? "flaky-$i.json" : "flaky.json";
  +          var flakyTests =
  +              await loadResultsMap("${outDirectory.path}/$flakyFileName");
  +          if (needsConfigurationOverride) {
  +            overrideConfiguration(
  +                flakyTests, namedConfigurations.single, localConfiguration);
  +          }
  +          mergedFlaky.addAll(flakyTests);
  +        }
  +      }
  +    }
  +    // Deflake results of the tests if required.
       if (options["deflake"]) {
         await deflake(outDirectory, configurationsToRun, options.rest);
       }
  -
  +    // Write out the merged results for the builders.
  +    if (needsMerge || needsConfigurationOverride) {
  +      await new File("${outDirectory.path}/previous.json").writeAsString(
  +          mergedResults.values.map((data) => jsonEncode(data) + "\n").join(""));
  +    }
  +    // Ensure that there is a flaky.json even if it wasn't downloaded.
  +    if (needsMerge || needsConfigurationOverride || options["report-flakes"]) {
  +      await new File("${outDirectory.path}/flaky.json").writeAsString(
  +          mergedFlaky.values.map((data) => jsonEncode(data) + "\n").join(""));
  +    }
       // Write out the final comparison.
       print("".padLeft(80, "="));
       print("Test Results");
  
positive.code:     exitCode = 1;
      return;
    }
  
    for (final builder in configurations.builders) {
      if (localConfiguration != null) {
        print("Testing the named configuration $localConfiguration "
  
negative.code:       }
        final buildNumber = buildSearchResult.build.toString();
        print("Downloading results from builder $builder build $buildNumber...");
        tasks.add(cpGsutil(
            buildFileCloudPath(builder, buildNumber, "results.json"),
            "${outDirectory.path}/$previousFileName"));
        if (!options["report-flakes"]) {
          tasks.add(cpGsutil(
              buildFileCloudPath(builder, buildNumber, "flaky.json"),
              "${outDirectory.path}/$flakyFileName"));
        }
      }
      // Run the tests.
      final configurationsToRun = localConfiguration != null
          ? <String>[localConfiguration]
          : namedConfigurations;
      print("".padLeft(80, "="));
      print("Running tests");
      print("".padLeft(80, "="));
  