From 07e62e9c2dc97c7ef74f8cae995a90724db4b4ec Mon Sep 17 00:00:00 2001 From: zxyszx <299979470+zxyszx@users.noreply.github.com> Date: Thu, 13 Aug 2026 01:38:59 +0800 Subject: [PATCH] test: wait for manual backup completion --- apps/api/internal/app/backup_handlers_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/api/internal/app/backup_handlers_test.go b/apps/api/internal/app/backup_handlers_test.go index f6447e3..21a09f1 100644 --- a/apps/api/internal/app/backup_handlers_test.go +++ b/apps/api/internal/app/backup_handlers_test.go @@ -316,6 +316,19 @@ func TestManualBackupReusesSavedPassword(t *testing.T) { if err != nil || password != "SharedBackupPassword9" { t.Fatalf("saved password changed: %q, %v", password, err) } + deadline := time.Now().Add(10 * time.Second) + for { + a.backupMu.Lock() + status := a.backupJob.Status + a.backupMu.Unlock() + if status != "running" { + break + } + if time.Now().After(deadline) { + t.Fatal("manual backup did not finish before timeout") + } + time.Sleep(20 * time.Millisecond) + } } func TestPublicServerIPValidation(t *testing.T) {