Add support to set max test attempts.

By default all the tests were retried 3 times but that behavior is
counter productive for linter validations.

Bug: https://github.com/flutter/flutter/issues/128083
Change-Id: I77862d5442cd0b0b4bae0841f715494ecc89cd83
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/45322
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
Reviewed-by: Jason Simmons <jsimmons@google.com>
diff --git a/recipes/engine_v2/builder.py b/recipes/engine_v2/builder.py
index 99167f0..4f71171 100644
--- a/recipes/engine_v2/builder.py
+++ b/recipes/engine_v2/builder.py
@@ -125,7 +125,11 @@
       # Run within another context to make the logs env variable available to
       # test scripts.
       with api.context(env=env, env_prefixes=env_prefixes):
-        api.retry.wrap(run_test, step_name=test.get('name'))
+        api.retry.wrap(
+            run_test,
+            max_attempts=test.get('max_attempts', 3),
+            step_name=test.get('name')
+        )
     finally:
       api.logs_util.upload_logs(test.get('name'))