[Workflow] Fix flaky example(#26960)

Signed-off-by: Siyuan Zhuang <suquark@gmail.com>
This commit is contained in:
Siyuan (Ryans) Zhuang 2022-07-25 12:00:45 -07:00 committed by GitHub
parent e8222ff600
commit 0e1b77d52a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,6 +38,8 @@ def custom_retry_strategy(func: Any, num_retries: int, delay_s: int) -> str:
if __name__ == "__main__":
# Default retry strategy.
print(workflow.run(flaky_step.options(max_retries=10).bind()))
print(
workflow.run(flaky_step.options(max_retries=10, retry_exceptions=True).bind())
)
# Custom strategy.
print(workflow.run(custom_retry_strategy.bind(flaky_step, 10, 1)))