Tests in test_risk_filter.py fail when CI runs shortly after midnight UTC

Abierto Apto para principiantes
#738 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 6 días

@Majyles ya está trabajando en esto.

Desde el 7/11/2026.

  • #742 de @Majyles — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
85/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
fastapi, python
Área
api, testing

Línea de trabajo

Lee src/tests/endpoints/test_risk_filter.py, empezando por test_sequences_fromdate_pagination_filters_before_limit y la prueba del interruptor de desactivación risk_score=moderate alrededor de la línea 392. Busca otras pruebas del archivo que combinen semillas minutes_ago con from_date=today y haz que sus fechas sean independientes de la hora UTC actual. Ejecuta las pruebas pytest del archivo; estará listo cuando pasen a cualquier hora del día sin cambios en los endpoints.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Context

The pytest job of #724 failed at 00:28 UTC on 2026-10-30 (run 40979934588) on two tests that the PR did not touch. A re-run during the day passed.

Cause

In src/tests/endpoints/test_risk_filter.py, test_sequences_fromdate_pagination_filters_before_limit and the risk_score=moderate kill-switch test (around line 392) seed sequences with _seed_unlabeled_sequence(..., minutes_ago=30..50) and then query /sequences/all/fromdate?from_date=<today UTC>. Within ~50 minutes after midnight UTC, the seeded sequences fall on the previous day and are not returned:

tests/endpoints/test_risk_filter.py:392: assert set(seeded).issubset(returned_ids) -> assert False
tests/endpoints/test_risk_filter.py:631: assert len(page) == 3 -> assert 1 == 3
What has to be done
  • Make these tests independent of the current UTC hour, e.g. seed at a fixed time earlier today (midnight + a few minutes) or derive from_date from the seeded started_at.
  • Check the other tests of the file that use the same minutes_ago + from_date=today pattern.
Done when
  • The file passes whatever the time of day
  • No endpoint change
Lenguaje dominante
Python
Estrellas
30
Forks
15
Merge medio
7 d 16 h
PR fusionados (30 d)
16

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pyronear/pyro-api

Todos los issues de pyronear/pyro-api

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.