Skip to content

[BUG-031] test_peer_ping fixture fails in sandbox: public IP unreachable, fixture timeout too long #16

Description

@Kickflip73

问题描述

test_peer_ping.pyrelay_pair fixture 在沙箱环境中持续失败(7/10 ERROR),根因有两个:

根因 1:公网 IP 不可达

  • Alpha relay 启动后 /status 返回公网 IP link(如 acp://33.x.x.x:PORT/tok_xxx
  • Beta 通过该 link --join Alpha,但沙箱内公网 IP 不可达
  • Alpha 始终看不到 Beta 为已连接 peer

根因 2:fixture 轮询窗口过长

  • 原始代码等待 120×0.5s=60s 来获取 link,但 relay 实测 3s 内即有 link
  • 整个 fixture setup 超过 60s,被 pytest-timeout 杀死

修复方案(commit 82ff68c

  1. /status link 提取 token,重写为 acp://127.0.0.1:<port>/<token> 本地地址
  2. 轮询窗口 120→30 次
  3. pyproject.toml 添加 timeout = 90 默认值

Priority: P2 — 不影响核心功能,影响 CI 可靠性

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions