Skip to content

ENH: Add explicit timeouts to ThrustCurve API requests and update changelog#940

Open
Copilot wants to merge 3 commits intorel/v1.12.0from
copilot/sub-pr-935
Open

ENH: Add explicit timeouts to ThrustCurve API requests and update changelog#940
Copilot wants to merge 3 commits intorel/v1.12.0from
copilot/sub-pr-935

Conversation

Copy link

Copilot AI commented Mar 18, 2026

Pull request type

  • Code changes (bugfix, features)
  • Code maintenance (refactoring, formatting, tests)
  • ReadMe, Docs and GitHub updates
  • Other (please describe):

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

Both the search and download requests.get() calls in Motor._call_thrustcurve_api() had no explicit timeout, allowing indefinite hangs in slow/offline network environments.

New behavior

Both ThrustCurve API calls now use an explicit timeout tuple:

_timeout = (5, 30)  # (connect timeout, read timeout) in seconds

Applied to:

  • Search request (/search.json)
  • Download request (/download.json)

The method docstring now documents requests.exceptions.Timeout as a possible exception.

Additionally, based on review feedback, CHANGELOG.md was updated under [Unreleased] → Fixed to include this PR change.

Breaking change

  • Yes
  • No

Additional information

Targeted validation was run for the affected area:

  • python -m pytest tests/unit/motors/test_genericmotor.py -q9 passed

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback from PR #935 for rel/v1.12.0 changes ENH: Add explicit timeouts to ThrustCurve API requests Mar 18, 2026
Copilot AI requested a review from MateusStano March 18, 2026 01:29
@MateusStano
Copy link
Member

@copilot add pr to changelog

@RocketPy-Team RocketPy-Team deleted a comment from Copilot AI Mar 18, 2026
@MateusStano MateusStano marked this pull request as ready for review March 18, 2026 01:56
@MateusStano MateusStano requested a review from a team as a code owner March 18, 2026 01:56
Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 18, 2026

@copilot add pr to changelog

Done in 3aaa71c — added this change to CHANGELOG.md under Unreleased → Fixed. No UI changes (changelog-only update).

Copilot AI changed the title ENH: Add explicit timeouts to ThrustCurve API requests ENH: Add explicit timeouts to ThrustCurve API requests and update changelog Mar 18, 2026
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.06%. Comparing base (1618fb0) to head (3aaa71c).

Additional details and impacted files
@@             Coverage Diff              @@
##           rel/v1.12.0     #940   +/-   ##
============================================
  Coverage        81.05%   81.06%           
============================================
  Files              107      107           
  Lines            13891    13892    +1     
============================================
+ Hits             11260    11261    +1     
  Misses            2631     2631           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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