Skip to content

Eclipse observation test incorrectly assumes countdowns always decrease #359

Closed

Description

@dhutererprats

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: 5700 seconds.

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  # fails

The 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

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 -q

All 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

  1. added
    bugSomething isn't working
    triageNeeds to be reviewed by a maintainer
    on Oct 7, 2026
  2. added 3 commits that reference this issue on Oct 7, 2026
  3. added a commit that references this issue on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNeeds to be reviewed by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions