Skip to content

Conversation

@pnuu
Copy link
Member

@pnuu pnuu commented Nov 6, 2025

If there was a timeout downloading TLEs from for example Celestrak, the http timeout raised an exception and the fetch_tles.py script terminated without saving any TLEs even if they were available from other sourves. This PR changes the exception to a logged error.

  • Tests added

@pnuu pnuu requested a review from mraspaud November 6, 2025 12:14
@pnuu pnuu self-assigned this Nov 6, 2025
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one question inline

source, len(failures), ", ".join(failures))
logging.info("Downloaded %d TLEs from %s",
len(tles[source]), source)
logging.info("Downloaded %d TLEs from %s", len(tles[source]), source)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a check that raises an error if none of the sources worked?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think so. If there's no data the database is not updated, whether it is due to network errors or the database already having the newest data stored.

@pnuu
Copy link
Member Author

pnuu commented Nov 6, 2025

I'll have a look at the CI failure, which I didn't get locally...

@pnuu
Copy link
Member Author

pnuu commented Nov 6, 2025

Well, I did have the failures also locally, just didn't run the tests after adding if req and ... condition.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.45%. Comparing base (875e479) to head (b55ac29).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #213      +/-   ##
==========================================
+ Coverage   90.35%   90.45%   +0.10%     
==========================================
  Files          19       19              
  Lines        3027     3039      +12     
==========================================
+ Hits         2735     2749      +14     
+ Misses        292      290       -2     
Flag Coverage Δ
unittests 90.45% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@coveralls
Copy link

Coverage Status

coverage: 90.419% (+0.1%) from 90.315%
when pulling b55ac29 on pnuu:fix-tle-download-timeout-failure
into 51bbe8e on pytroll:main.

@mraspaud mraspaud merged commit 6fb2cbb into pytroll:main Nov 6, 2025
16 checks passed
@pnuu pnuu deleted the fix-tle-download-timeout-failure branch November 6, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants