anchor.diff:      await outDirectory.delete(recursive: true);
     }
   }
  +
  +void deflake(Directory outDirectory, String localConfiguration,
  +    List<String> testPyArgs) async {
  +  // Find the list of tests to deflake.
  +  final deflakeListOutput = await runProcess(Platform.resolvedExecutable, [
  +    "tools/bots/compare_results.dart",
  +    "--changed",
  +    "--failing",
  +    "--passing",
  +    "--flakiness-data=${outDirectory.path}/flaky.json",
  +    "${outDirectory.path}/previous.json",
  +    "${outDirectory.path}/results.json",
  +  ]);
  +  final deflakeListPath = "${outDirectory.path}/deflake.list";
  +  final deflakeListFile = new File(deflakeListPath);
  +  await deflakeListFile.writeAsString(deflakeListOutput.stdout);
  +
  +  // Deflake the changed tests.
  +  final deflakingResultsPaths = <String>[];
  +  for (int i = 1; deflakeListOutput.stdout != "" && i <= deflakingCount; i++) {
  +    print("".padLeft(80, "="));
  +    print("Running deflaking iteration $i");
  +    print("".padLeft(80, "="));
  +    final deflakeDirectory = new Directory("${outDirectory.path}/$i");
  +    await deflakeDirectory.create();
  +    final deflakeArguments = <String>[
  +      "--named-configuration=$localConfiguration",
  +      "--output-directory=${deflakeDirectory.path}",
  +      "--clean-exit",
  +      "--silent-failures",
  +      "--write-results",
  +      "--test-list=$deflakeListPath",
  +      ...testPyArgs,
  +    ];
  +    await runProcessInheritStdio(
  +        "python", ["tools/test.py", ...deflakeArguments],
  +        runInShell: Platform.isWindows);
  +    deflakingResultsPaths.add("${deflakeDirectory.path}/results.json");
  +  }
  +
  +  // Update the flakiness information based on what we've learned.
  +  print("Updating flakiness information...");
  +  await runProcess(Platform.resolvedExecutable, [
  +    "tools/bots/update_flakiness.dart",
  +    "--input=${outDirectory.path}/flaky.json",
  +    "--output=${outDirectory.path}/flaky.json",
  +    "${outDirectory.path}/results.json",
  +    ...deflakingResultsPaths,
  +  ]);
  +}
  
positive.code:   }
    final namedConfiguration = namedConfigurations.single;
    final localConfiguration =
        options["local-configuration"] ?? namedConfiguration;
    for (final builder in builders) {
      if (localConfiguration != namedConfiguration) {
        print("Testing the named configuration $localConfiguration "
  
negative.code:       await Process.run(executable, arguments, runInShell: runInShell);
    if (processResult.exitCode != 0) {
      final command =
          [executable, ...arguments].map(simpleShellSingleQuote).join(" ");
      throw new Exception("Command exited ${processResult.exitCode}: $command\n"
          "${processResult.stdout}\n${processResult.stderr}");
    }
  