Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Prove that disk and network peers obey the same Peer protocol

Aperta Adatta ai principianti
#385 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
70/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
postgresql, python

Direzione di ricerca

Inizia da tests/testapp/tests/integration/test_peer_protocol_contract.py, leggendo la sottoclasse di rete di #372 e l’harness del secondo server in tests/testapp/tests/integration/test_syncsession.py. Aggiungi la sottoclasse disco usando un percorso temporaneo e un alias di archivio, quindi esegui python -O -m pytest tests/testapp/tests/integration/test_peer_protocol_contract.py -v nell’ambiente postgres tox. Il lavoro è completato quando entrambe le sottoclassi superano tutti e sette i casi di contratto invariati.

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

Descrizione

DEV: backend DEV: dev-ops TAG: unit tests

Overview

The contract suite runs its cases against the disk connection, so that both connection types show the same Peer protocol behavior. This issue is part of milestone M7 (verification).

Background & Motivation

#372 wrote the contract suite and ran it against the network connection. The network connection is the reference implementation. The disk connection copies the order of the server stage steps, and that copy can drift from the server behavior over time.

A run of the same cases against the disk connection catches this drift early. If a case fails, the test identifies the exact protocol behavior that differs.

Design: spec. Plan: implementation plan, Task 24.

Description & Expected Outcomes

A disk subclass of the contract suite runs every contract case with a DiskSyncConnection on a temporary path. The subclass reads the peer records from the archive alias. The contract cases themselves do not change.

If a disk case fails, the fix goes into DiskSyncConnection. The contract case stays as the reference behavior.

Deliverables & Contracts

The feature delivers these capabilities:

  • A disk subclass of PeerProtocolContract in the contract suite.
  • All contract cases pass for the network subclass and the disk subclass.
Acceptance Criteria
  • DiskPeerProtocolTestCase exists and runs all cases of PeerProtocolContract.
  • All seven contract cases pass for both subclasses.
  • No contract case changes in this issue.
  • The contract suite passes in the postgres tox environment.

Technical Pointers & Architecture

  • Target Components / Context: tests/testapp/tests/integration/test_peer_protocol_contract.py.
  • Related Patterns: The network subclass from #372 and the second-server harness in tests/testapp/tests/integration/test_syncsession.py.
  • Data Model & Schema Considerations: None.
  • Resilience & Failure Modes: Contract case 6 expects a rejection of records outside the filter. The network raises requests.HTTPError, and the disk connection raises ValidationError.

Notes & Tradeoffs

  • Dependencies: Blocked by: #372 (contract suite, network half), #384 (disk Peer protocol). Blocks: none.
  • Testing Requirements: Integration tests. Run python -O -m pytest tests/testapp/tests/integration/test_peer_protocol_contract.py -v.
  • Tradeoffs & Alternatives Considered: The parity test in #386 compares data outcomes. The contract suite compares protocol behavior. Both are necessary.

Metadata

  • Complexity: Low
  • Target Branch: release-v0.9.x

AI Usage

Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.

Lingua principale
Python
Stelle
15
Fork
23
Merge medio
1g 11h
PR unite (30g)
4

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 learningequality/morango

Tutte le issue di learningequality/morango

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.