Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce max retries in list_components #198

Merged
merged 2 commits into from
Dec 3, 2024
Merged

Enforce max retries in list_components #198

merged 2 commits into from
Dec 3, 2024

Conversation

shrik450
Copy link
Collaborator

@shrik450 shrik450 commented Dec 2, 2024

Earlier, we would retry forever if the JSON wasn't generated. This usually wasn't a problem because the JSON would eventually be generated or lead to a server error, but we've seen cases where this hasn't been true. Either way, we should've limited the number of retries, list_components just didn't count the number of attempts. This commit counts the attempts, stops at 5 retires, and tests this behavior.

@shrik450 shrik450 requested a review from a team as a code owner December 2, 2024 20:24
Base automatically changed from su/1.22 to main December 2, 2024 20:32
Earlier, we would retry forever if the JSON wasn't generated. This
usually wasn't a problem because the JSON would eventually be generated
*or* lead to a server error, but we've seen cases where this hasn't been
true. Either way, we should've limited the number of retries,
`list_components` just didn't count the number of attempts. This commit
counts the attempts, stops at 5 retires, and tests this behavior.
The default sleep time between retries is too short for orcad/system
capture files. This commit increases the sleep time to 1 second, giving
a total of roughly 4 seconds to time out. Ideally we'd make this a
configurable parameter, but that requires a lot more work and would also
involve generate-bom.
Copy link

github-actions bot commented Dec 2, 2024

Coverage Summary

Total Project Coverage

  • Line Coverage: 87.01% (2057/2364)
  • Branch Coverage: 71.93% (433/602)

Coverage by File

File Line Coverage Branch Coverage Lines (Covered/Total) Branches (Covered/Total)
allspice/__init__.py 100.00% 100.00% 5/5 0/0
allspice/allspice.py 81.43% 68.42% 171/210 52/76
allspice/apiobject.py 83.73% 46.35% 1045/1248 89/192
allspice/baseapiobject.py 85.29% 75.00% 87/102 24/32
allspice/exceptions.py 100.00% 100.00% 14/14 0/0
allspice/ratelimiter.py 100.00% 100.00% 22/22 4/4
allspice/utils/__init__.py 100.00% 100.00% 0/0 0/0
allspice/utils/bom_generation.py 100.00% 100.00% 112/112 40/40
allspice/utils/core.py 94.12% 50.00% 16/17 1/2
allspice/utils/list_components.py 92.24% 87.30% 535/580 213/244
allspice/utils/netlist_generation.py 92.59% 83.33% 50/54 10/12

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

  • allspice/utils/list_components.py (100%)

Summary

  • Total: 2 lines
  • Missing: 0 lines
  • Coverage: 100%

@kdumontnu kdumontnu merged commit 10fde4f into main Dec 3, 2024
4 checks passed
@kdumontnu kdumontnu deleted the su/retries branch December 3, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants