Skip to content

BUG-033: tests/cert/test_level1.py stop_reference_relay() wait(timeout=3) 导致 teardown TimeoutExpired #12

@Kickflip73

Description

@Kickflip73

现象

pytest tests/ 全套时,test_level1.py::test_c1_10_content_type teardown 报错:
subprocess.TimeoutExpired: wait(timeout=3) — relay SIGTERM 后需 >3s 退出。
结果:全套出现 1 error,虽然 10 个测试本身全部 passed。

根因

BUG-022(2026-03-25)修复了其他测试文件的 teardown,但 tests/cert/test_level1.py 第 44 行 RELAY_PROC.wait(timeout=3) 未一并修复。relay SIGTERM 后因公网 IP 探测阻塞,进程需 3~10s 退出。

修复方案

def stop_reference_relay():
    if RELAY_PROC:
        RELAY_PROC.send_signal(signal.SIGTERM)
        try:
            RELAY_PROC.wait(timeout=8)
        except subprocess.TimeoutExpired:
            RELAY_PROC.kill()
            RELAY_PROC.wait()

发现轮次

测试轮 AB(2026-03-27)

优先级

P2 — BUG-022 遗漏文件,影响 CI error 计数

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions