test(HH-609): decouple rollback watchdog
Docker image / Test (pull_request) Successful in 40s
Docker image / Build and publish (pull_request) Failing after 3m39s

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-08-24 14:21:30 +08:00
co-authored by multica-agent
parent 193013ba3b
commit 1e10a943b2
+18 -9
View File
@@ -282,16 +282,25 @@ func TestRunStopsServicesWhenRollbackReloadFails(t *testing.T) {
}))
defer server.Close()
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
runResult := make(chan error, 1)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
err := Run(ctx, RuntimeConfig{
CoreBinary: binary,
SSClashBinary: binary,
ConfigSource: config,
RuntimeDir: filepath.Join(tempDir, "runtime"),
SubscriptionURL: server.URL,
UpdateInterval: 20 * time.Millisecond,
})
go func() {
runResult <- Run(ctx, RuntimeConfig{
CoreBinary: binary,
SSClashBinary: binary,
ConfigSource: config,
RuntimeDir: filepath.Join(tempDir, "runtime"),
SubscriptionURL: server.URL,
UpdateInterval: 20 * time.Millisecond,
})
}()
var err error
select {
case err = <-runResult:
case <-time.After(5 * time.Second):
t.Fatal("Run() did not reach rollback failure")
}
if !errors.Is(err, errMihomoStateUncertain) {
t.Fatalf("Run() error = %v, want uncertain Mihomo state", err)
}