Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Prove that disk and network peers obey the same Peer protocol

Đang mở Phù hợp với người mới
#385 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
70/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
postgresql, python
Lĩnh vực
backend, testing-qa

Hướng nghiên cứu

Bắt đầu tại tests/testapp/tests/integration/test_peer_protocol_contract.py bằng cách đọc network subclass từ #372 và harness của server thứ hai trong tests/testapp/tests/integration/test_syncsession.py. Thêm disk subclass bằng cách sử dụng một đường dẫn tạm thời và archive alias, sau đó chạy python -O -m pytest tests/testapp/tests/integration/test_peer_protocol_contract.py -v trong môi trường postgres tox. Hoàn thành khi cả hai subclass đều vượt qua tất cả bảy contract case không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
15
Fork
23
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của learningequality/morango

Tất cả issue của learningequality/morango

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.