fix(video): 异步任务 - 完善全局轮询容错与调度策略
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"infinite-canvas/backend/internal/protocol"
|
||||
)
|
||||
@@ -348,6 +349,18 @@ func TestDeclarativeProtocolRuntimeExecutesCreatePollAndDownload(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeclarativeProtocolPollingPolicyOnlyChangesVideoBehavior(t *testing.T) {
|
||||
video := declarativeProtocolPollPolicy("video")
|
||||
if video.InitialDelay != defaultVideoPollInterval || !video.RetryTransient {
|
||||
t.Fatalf("video polling policy = %#v, want delayed resilient polling", video)
|
||||
}
|
||||
|
||||
image := declarativeProtocolPollPolicy("image")
|
||||
if image.InitialDelay != 0 || image.Interval != 2500*time.Millisecond || image.RetryTransient {
|
||||
t.Fatalf("image polling policy = %#v, want legacy immediate fail-fast polling", image)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeclarativeProtocolPollRecoversFromTransientGatewayFailure(t *testing.T) {
|
||||
adapter, err := protocol.LoadManifest([]byte(`{
|
||||
"apiVersion":"yingce.plugin/v1",
|
||||
|
||||
Reference in New Issue
Block a user