Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Prove that disk and network peers obey the same Peer protocol

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

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
70/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
postgresql, python

Línea de trabajo

Empieza en tests/testapp/tests/integration/test_peer_protocol_contract.py leyendo la subclase de red de #372 y el harness del segundo servidor en tests/testapp/tests/integration/test_syncsession.py. Añade la subclase de disco usando una ruta temporal y un alias de archivo, y luego ejecuta python -O -m pytest tests/testapp/tests/integration/test_peer_protocol_contract.py -v en el entorno postgres tox. Se considera terminado cuando ambas subclases superen los siete casos de contrato sin cambios.

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

Descripción

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.

Lenguaje dominante
Python
Estrellas
15
Forks
23
Merge medio
1 d 11 h
PR fusionados (30 d)
4

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

Todos los issues de learningequality/morango

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.