iop/apps/edge/internal/transport/heartbeat_test.go
toki 4cafc91323 fix(transport): 터널 지연에 맞춰 heartbeat 경계를 보강한다
장시간 provider prefill과 stream backpressure가 정상 노드를 끊지 않도록 liveness window를 확장하고 Chronos 분리 완료 문서와 잔여 artifact를 정리한다.
2026-08-02 22:30:25 +09:00

23 lines
917 B
Go

package transport
import "testing"
// TestHeartbeatWaitExceedsInterval guards the edge-side invariant. Even though
// the library now self-heals stale wait timers (proto-socket base_client.go,
// wait-timer state check), keeping wait > interval gives the peer's next
// heartbeat an extra chance to clear the stray timer before it fires, which
// keeps idle traffic stable on slow links. Mirror of the node-side test.
func TestHeartbeatWaitExceedsInterval(t *testing.T) {
if heartbeatWaitSec <= heartbeatIntervalSec {
t.Fatalf("heartbeatWaitSec (%d) must exceed heartbeatIntervalSec (%d)", heartbeatWaitSec, heartbeatIntervalSec)
}
}
func TestHeartbeatUsesTunnelTolerantLivenessProfile(t *testing.T) {
if heartbeatIntervalSec != 30 {
t.Fatalf("heartbeatIntervalSec: got %d want 30", heartbeatIntervalSec)
}
if heartbeatWaitSec != 45 {
t.Fatalf("heartbeatWaitSec: got %d want 45", heartbeatWaitSec)
}
}