atcoder-tools icon indicating copy to clipboard operation
atcoder-tools copied to clipboard

Add retry for each problem

Open firewood opened this issue 1 year ago • 3 comments
trafficstars

Why is this change needed?

問題の取得に失敗し、SampleDetectionError が発生することがある。(以前より失敗することが増えた気がする)

What did you implement?

  • Retry により3回リトライするようにした。初回は0.5秒。(リトライに失敗した場合は RetryError が発生する)
  • prepare_contest のほうのリトライは不要になったので削除した。

What behavior do you expect?

  • [ ] testに通ること
  • [ ] genコマンドの問題の取得の失敗が減ること (0.5秒後に自動リトライして取得に成功すること)
  • [ ] 存在しないコンテストを指定してgenを実行すると atcodertools.tools.envgen.EnvironmentInitializationError が発生すること。

firewood avatar Jun 09 '24 13:06 firewood

fixupまちがえました 🙇

firewood avatar Jun 09 '24 13:06 firewood

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.25%. Comparing base (30336a7) to head (4ff7041). Report is 16 commits behind head on stable.

Files Patch % Lines
atcodertools/client/atcoder.py 88.88% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           stable     #296      +/-   ##
==========================================
- Coverage   90.31%   90.25%   -0.07%     
==========================================
  Files          64       64              
  Lines        2788     2781       -7     
==========================================
- Hits         2518     2510       -8     
- Misses        270      271       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jun 09 '24 14:06 codecov-commenter

ありがとうございます! コード見る限りよさそうです!もともとのretryはコンテスト開始前にツールを起動した場合の失敗を主に想定していたんですが、ユースケースの区別なくネットワーク通信の深いところで統一的にretryを行うというのには同意です。 挙動に関してはこちらで確認して、よさそうならマージさせていただきます。

kyuridenamida avatar Jun 13 '24 12:06 kyuridenamida