#371: Extract backoff calculation into private helper#379
Conversation
|
CI failure note: The All 118 other tests pass, and all non-live checks (rubocop, copyrights, markdown-lint, pdd, reuse, xcop, actionlint, typos, yamllint) pass successfully. |
d7c9c2d to
0d1c4f9
Compare
GHX5T-SOL
left a comment
There was a problem hiding this comment.
Approved. I checked current head 0d1c4f949702b705a05a01c61c07775e1c5754f6 against #371. The change extracts the duplicated @pause * (2**attempt) formula from await and recover into a private backoff(attempt) helper without changing the retry branch conditions, logging, or sleep guard.
Validation:
bundle checkruby -c lib/baza-rb.rbgit diff --check upstream/master...HEAD- local no-network helper probe with intercepted
sleep:backoff(1)=6,backoff(2)=12forpause: 3;awaitretried429 -> 200once andrecoverretried499 -> 200once, both recording the same6sdelay as before - focused retry tests:
4tests /5assertions - full non-live suites:
test/test_baza_edge.rb(48tests /137assertions),test/test_baza.rb(26/22), andtest/test_fake.rb(40/53) bundle exec rubocop:12files, no offensesbundle exec rake picksbundle exec rake yard:96.23%documented
I did not run full local bundle exec rake because it invokes live Zerocracy API tests. Hosted Ubuntu rake on this head fails only TestBazaLive#test_live_full_cycle with Job #76630 ... did not finish in 0s; hosted macOS rake was canceled.
|
@GHX5T-SOL Thanks for the review! You've earned +6 points for this contribution. Here's the breakdown per our work policy: +18 points as the baseline reward, -8 points deducted for posting absolutely no comments during review (as required by policy), and -4 points deducted for having only 12 hits-of-code (below the 24 minimum threshold). Your running score is +1432 - keep up the great work and don't forget to check your Zerocracy account! 🚀 |
|
@yegor256 this PR is blocked by the All our PRs have been rebased on the test fix from #393 (increased timeout, unique job names, fixed elapsed time display). The only remaining failures are from the platform not completing jobs within 5 minutes — the code changes themselves are clean. A review and platform fix would unblock all of these. Thanks! |
Server Status Update (29 Jun 2026)The Server is alive but jobs are stuck for hours
Timeline
What it means for our PRsAll our open PRs (#379, #380, #381, #382, #383, #384, #385, #387, #389, #390, #392, #393) are blocked by this same infrastructure issue. The code changes in each PR are clean and pass all unit tests. Once the Zerocracy platform is restored (likely a restart of swarm worker #4 or clearing a stuck queue), all PRs should become green without any code changes on our side. Suggestion: Check the /cc @yegor256 |
Server-side root cause analysis (swarm-template)Looking deeper at the job status we observed on the live server: This tells us that the job was picked up by a swarm worker ( The connection to
|
e608457 to
14662b4
Compare
|
@yegor256 plz re-review |
|
@VasilevNStas Thanks for the contribution! You've earned +20 points for this: +24 as a basis; -4 for too few (12) hits-of-code. Please, keep them coming. Your running score is +2212; don't forget to check your Zerocracy account too). |
Problem
The exponential backoff formula
@pause * (2**attempt)was duplicated inawaitandrecover.Solution
Extracted into a private
backoff(attempt)helper method.Verification
bundle exec rubocop— 0 offensesCloses #371.