Repository navigation
Description
Describe the bug
The existing TestEclipse.test_eclipse_state integration test assumed that both eclipse countdowns could only decrease after a 5700-second step. That assumption is incorrect when the step passes an eclipse transition: the next entry into Earth's shadow then refers to a later orbit, so its countdown can increase.
The test also used a random orbit and an unpinned epoch, making this failure depend on the initial conditions. This is a bug in the test assertions, not in eclipse prediction.
To reproduce
Use the deterministic setup now recorded in TestEclipse:
- UTC epoch:
2025 JAN 01 00:00:00.000 (UTC). - Circular orbit from
random_orbit(i=45, Omega=0, omega=0, f=34). - Reset seed:
0. - Step duration:
5700seconds.
Reapplying the original assertion to those observations gives:
# Seconds until the next shadow entry and exit:
observation1 = [30.0, 2130.0]
observation2 = [5670.0, 2070.0] # after the 5700-second step
assert observation2[0] - observation1[0] < 0.05 # failsThe later shadow entry is correct. The test should not require a countdown to keep decreasing after the event it previously referred to has passed.
Expected behavior
With fixed initial conditions, check that countdowns decrease by the elapsed time before a transition, that passing shadow entry advances the next-entry prediction while preserving the upcoming exit, and that stepping past a full orbit produces finite positive countdowns to later transitions.
Version
- Verified locally with Python 3.11.9 and Basilisk 2.13.0b0 on macOS.
- BSK-RL PR Feature: Space-to-Space RSO Imaging #356 at
223429506ceee2cd28182249202c4d260d6a983a.
Fix and tracking
The test correction is already in PR #356, in its separate eclipse-test commit. The simulator and eclipse-prediction implementation are unchanged. This issue records the reason for that unrelated fix, as requested in this review (#356 (comment)).
The PR will also carry a separate release-note bullet identifying this as a test bug fix.
Validation:
pytest tests/integration/obs/test_int_observations.py::TestEclipse -qAll three tests pass: ordinary countdown, crossing shadow entry, and stepping past a full orbit. Close this issue when PR #356 is merged with the tracking link and release note.
Activity
[#359] Make eclipse observation regressions deterministic
[#357] Document the space-to-space imaging API and model contracts
[#359] Make eclipse observation regressions deterministic
[#357] Document the space-to-space imaging API and model contracts