test: dequeue expiry contract test fails on slow Postgres
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #1022 de @stromanni — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- postgresql, rust
- Área
- databases, testing-qa
Línea de trabajo
Comienza con crates/flexiq-core/tests/rust/storage_tests.rs, especialmente con test_dequeue_reports_expired_jobs y la segunda llamada a dequeue_from_reporting; revisa postgres/jobs.rs::scan_dequeue_candidates y ejecuta el comando cargo test proporcionado contra Postgres alojado. La tarea está completada cuando la prueba de contrato pasa de forma fiable con Postgres lento y se alcanzan las pruebas de storage registradas posteriormente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
postgres_storage_tests fails deterministically against a hosted Postgres (Neon, both the pooled and the direct endpoint), on master as well as on feature branches:
panicked at crates/flexiq-core/tests/rust/storage_tests.rs:204:5:
assertion `left == right` failed
left: None
right: Some("<live job id>")
The failing assertion is in test_dequeue_reports_expired_jobs, on the second half, the single-job dequeue_from_reporting call. The first half, the batch dequeue, passes.
Likely cause: the test, not the dequeue
The test reads now = now_millis() once at its start and dequeues at now + 1_000 in both halves. Each enqueued job's scheduled_at is the wall clock at the time it was enqueued, and the Postgres candidate scan (postgres/jobs.rs::scan_dequeue_candidates) keeps only scheduled_at <= now.
A hosted database adds a few hundred milliseconds per round trip. By the time the second pair of jobs is enqueued, more than a second has passed since now was read. Their scheduled_at is therefore later than now + 1_000, the scan returns no candidates, and the claim comes back None. A CI Postgres container answers fast enough that the window never closes, which is why CI stays green.
Why it matters
run_storage_tests stops at this panic. Every contract test registered after test_dequeue_reports_expired_jobs never runs against a hosted Postgres, so a regression in any of them goes unseen locally.
Suggested fix
Take a fresh now_millis() for each half, or pass now_millis() + 1_000 at the dequeue call itself. That keeps expires_at in the past and scheduled_at in the past relative to the dequeue time, however slow the backend is. Other tests that capture now once and dequeue later may share the pattern and are worth checking.
Repro
FLEXIQ_POSTGRES_TEST_URL=<hosted postgres url> \
cargo test -j1 -p flexiq-core --features postgres --test rust -- postgres
- Lenguaje dominante
- Rust
- Estrellas
- 20
- Forks
- 2
- Merge medio
- 7 h 19 min
- PR fusionados (30 d)
- 89
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ByteVeda/flexiq
-
Windows Java smoke: ContractFloorTest fails in TempDir cleanupPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea/ci bug java P2 tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area/sdk-ruby area/wire enhancement epic P2
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
area/sdk-ruby ci P2 packaging
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
docs enhancement P1
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
enhancement P2 storage
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de ByteVeda/flexiq
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
element-hq/lk-jwt-service#248 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pact-foundation/pact-cli#154 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
antithesishq/bombadil#361 ·
Los mantenedores suelen responder en 1 día
-
test(executor_l0): assert execute() TaskOutcome, not only bus events / 断言 execute() 返回的 TaskOutcomeAbiertotype:debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
skaiy/wild_agentos#425 ·
Los mantenedores suelen responder en 1 día