test: extend existing query-parity harness to heartbeat ingestion

Aperta
#1,568 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, rust
Ambito
testing-qa

Direzione di ricerca

Start from the existing query-parity harness in scripts/tests/query_parity/, which the issue says already launches both servers and normalizes results; read how Server.insert_events is used there. Add a heartbeat sequence path that posts identical payloads with fixed pulsetimes to fresh buckets on both servers, then diff the normalized stored events and flood/merge_events_by_keys outputs. Done when the heartbeat cases pass or each mismatch has a minimal sequence and a linked bug.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Test-first collection-integrity child of #724. Reuse the existing Python/Rust query-parity harness from #1467 (scripts/tests/query_parity/); do not build another server launcher or normalization layer.

The current suite inserts events directly with Server.insert_events. It covers overlap/containment, identical ranges and equal timestamps, and runs flood/merge_events_by_keys, but does not send heartbeat sequences through the collection endpoint. The residual scope is heartbeat ingestion and the analysis of the stored results.

Task

Extend that harness to send identical sequential heartbeat payloads and pulsetimes to fresh buckets on both servers, then read back and compare their normalized stored events. Cover:

  • steady identical-data heartbeats;
  • a gap beyond pulsetime;
  • a data change;
  • the exact pulsetime boundary and either side of it;
  • same-timestamp/different-duration inputs and contained/overlapping inputs (negative gaps).

Run the existing flood and merge_events_by_keys query templates on the heartbeat-produced events to check downstream parity. Reuse existing overlap fixtures where suitable instead of duplicating the direct-insert transform corpus.

Acceptance

  • Both servers receive the same payloads in the same sequential order, with identical pulsetimes, in isolated testing instances and fresh buckets.
  • Stored-event results and downstream query results compare through the existing normalization/diff helpers.
  • Each mismatch has the smallest heartbeat sequence, pulsetime, server revisions and a linked bug; no unowned xfails.
  • Existing direct-insert query-parity cases remain intact. No new fixture-sync mechanism or duplicate startup helpers.
  • No production heartbeat changes unless a test first reproduces a defect.

Out of scope: reimplementing the out-of-order replacement fixes (ActivityWatch/aw-server#177 and ActivityWatch/aw-server-rust#555); concurrent requests (tracked separately in #1566); another generic overlap transform suite.

The infrastructure prerequisite is already satisfied by #1467 (merged September 26), not the newly filed duplicate #1567, which has been closed with evidence. Current-master query-parity CI: https://github.com/ActivityWatch/activitywatch/actions/runs/44886830413 (3130 passed, 98 issue-attributed strict xfails).

Lingua principale
Python
Stelle
19.7k
Fork
1.1k
Merge medio
2g 19h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ActivityWatch/activitywatch

Tutte le issue di ActivityWatch/activitywatch

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.