X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/80e348724041a694002fc38f57e8868b9b9a2be9..c781f79f3c8cb9a7577ee1574d196988da2719b3:/backup_test.go diff --git a/backup_test.go b/backup_test.go index 8628ee4..2fb218a 100644 --- a/backup_test.go +++ b/backup_test.go @@ -26,6 +26,7 @@ func TestRunningDaemonBackupRestoresTheChatAndLinks(t *testing.T) { "agent/instructions.md": "Keep the instructions.\n", "agent/telegram-offset.json": "23\n", } + for name, data := range files { path := filepath.Join(dir, name) require.NoError(t, os.MkdirAll(filepath.Dir(path), 0o700)) @@ -236,6 +237,7 @@ func TestUnsafeRestoreInstallsNoArchiveFiles(t *testing.T) { Mode: 0o600, }, ) + dir := t.TempDir() err := backupRestore(t.Context(), archive, dir) require.ErrorContains(t, err, "unsafe archive path") @@ -337,6 +339,7 @@ func TestSessionBackupWaitsForRemovalToFinish(t *testing.T) { require.Never(t, func() bool { return len(backedUp) != 0 }, 50*time.Millisecond, time.Millisecond) + release.Do(func() { close(disconnect.release) })