Files
Agent-System-Backend/internal/runmgr/hitl_timeout_test.go
T
weichen f1302ed5b3 Enable canonical versioned Go module consumption
Why: Allow consumers to download an immutable module revision without nested source checkouts or local path replacements.

Evidence: SELF package tests and the prior canonical-path rejection are recorded in the Dev dependency-workspace task card; remote consumption is replayed against the committed candidate.

Impact: Change the module identity and its Go imports while preserving API behavior. Existing historical submodule revisions remain buildable.

Refs: Versioned dependencies U1/U3; feature/dependency-workspace
2026-10-13 15:47:16 +00:00

28 lines
648 B
Go

package runmgr
import (
"context"
"strings"
"testing"
"time"
core "git-ssh.u1680832.nyat.app/weichen/Agent-System-Core.git"
)
func TestWaitHITLTimeout(t *testing.T) {
ch := make(chan hitlAnswer)
_, err := waitHITL(context.Background(), ch, 20*time.Millisecond)
if err == nil || !strings.Contains(err.Error(), "timed out") {
t.Fatalf("got %v", err)
}
}
func TestWaitHITLAnswer(t *testing.T) {
ch := make(chan hitlAnswer, 1)
ch <- hitlAnswer{resp: core.HITLResponse{ChoiceID: "ok"}}
resp, err := waitHITL(context.Background(), ch, time.Second)
if err != nil || resp.ChoiceID != "ok" {
t.Fatalf("resp=%+v err=%v", resp, err)
}
}