Apply max_attempts to tester_engine.

This is to avoid retries on expensive tests.

Bug: https://github.com/flutter/flutter/issues/128083
Change-Id: Iffe3f52f831d50acfb5f1de2e0d2437352362626
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/45401
Reviewed-by: Ricardo Amador <ricardoamador@google.com>
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
Reviewed-by: Keyong Han <keyonghan@google.com>
diff --git a/recipes/engine_v2/tester_engine.py b/recipes/engine_v2/tester_engine.py
index 3047861..e4356d6 100644
--- a/recipes/engine_v2/tester_engine.py
+++ b/recipes/engine_v2/tester_engine.py
@@ -103,7 +103,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=task.get('name'))
+        api.retry.wrap(
+            run_test,
+            step_name=task.get('name'),
+            max_attempts=task.get('max_attempts', 3)
+        )
     finally:
       api.logs_util.upload_logs(task.get('name'))