MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / TestAPIDispatcher_ProbeLatency

Function TestAPIDispatcher_ProbeLatency

internal/nodeagent/dispatch_test.go:246–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

244}
245
246func TestAPIDispatcher_ProbeLatency(t *testing.T) {
247 t.Parallel()
248 d := NewAPIDispatcher(newTestAPI(), nil)
249 // 给一个会很快超时的 ctx,避免实际网络访问。
250 ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
251 defer cancel()
252 body, err := d.Handle(ctx, "ProbeLatency", nil)
253 if err != nil {
254 t.Fatalf("err: %v", err)
255 }
256 if !json.Valid(body) {
257 t.Fatalf("invalid body: %s", body)
258 }
259}
260
261// ── ConfigHasher 测试 ────────────────────────────────────────────
262

Callers

nothing calls this directly

Calls 4

HandleMethod · 0.95
NewAPIDispatcherFunction · 0.85
newTestAPIFunction · 0.85
ValidMethod · 0.80

Tested by

no test coverage detected