Skip to content

Tom observations cadence RetryFailedObservationsStrategy isn't updating dynamic cadence #1413

@moira-andrews

Description

@moira-andrews

Describe the bug
The single observation strategy RetryFailedObservationsStrategy in tom_observations does not update the DynamicCadence object associated with the observation group to set active = False upon completion. This causes the cadence to show up and clutter ./manage.py runcadencestrategies even though the observation is not active anymore upon completion. The strategy also does not update the observation group in the database to reflect the observation status from OCS. When an observation is submitted and ./manage.py runcadencestrategies is run, the observation does not reflect a 'PENDING' observation states. The repeating strategy (ResumeCadenceAfterFailureStrategy) does not reflect this bug and does update the status to PENDING and since it is only stopped on cancellation, it does not experience the issue with the DynamicCadence needing to be turned off upon a completed observation.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a target page on TOM Demo or a fresh TOM that has the form
  2. Under "Observe" click on "LCO" then open the "Photometric Sequence" form, or select an observation template
  3. Select "Once in the next" or "RetryFailedObservationsStrategy" under "cadence strategy"
  4. Input observing parameters and submit
  5. Upon completion of the observation, the sequence will still appear in the Dynamic Cadence table and when running ./manage.py runcadencestrategies

Expected behavior
Upon observation request (or when runcadencestrategies is run), the ObservationRecord status should update from '' to 'PENDING'. Similarly updating to 'COMPLETE' upon completion. When the observation is complete, the DynamicCadence should be turned off. If a failure in the observation occurs, the observation should be re-requested with a shifted window and is only finished when a complete state is reached.

Metadata

Metadata

Labels

UserIssue Raised by a userbugSomething isn't working

Type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions