Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67c4421033 |
@@ -586,10 +586,11 @@ func TestBackupCompletesOnlyAfterMetadataExport(t *testing.T) {
|
|||||||
ctx, t, cfg, inner, repos, db, fs, restoreDir, testFiles)
|
ctx, t, cfg, inner, repos, db, fs, restoreDir, testFiles)
|
||||||
}
|
}
|
||||||
|
|
||||||
// assertRetryConsistentAndRestorable checks the end state after the retry
|
// assertRetryConsistentAndRestorable checks the end state after a backup
|
||||||
// backup in TestBackupCompletesOnlyAfterMetadataExport: the interrupted
|
// retried on the same index once an earlier run stopped at its metadata
|
||||||
// snapshot is pruned, exactly one completed snapshot remains, its metadata
|
// export: the interrupted snapshot is pruned, exactly one completed
|
||||||
// is at the destination, and it restores to the original tree.
|
// snapshot remains, its metadata is at the destination, and it restores
|
||||||
|
// to the original tree.
|
||||||
func assertRetryConsistentAndRestorable(
|
func assertRetryConsistentAndRestorable(
|
||||||
ctx context.Context, t *testing.T, cfg *config.Config,
|
ctx context.Context, t *testing.T, cfg *config.Config,
|
||||||
inner storage.Storer, repos *database.Repositories, db *database.DB,
|
inner storage.Storer, repos *database.Repositories, db *database.DB,
|
||||||
|
|||||||
@@ -163,19 +163,8 @@ func TestPruneDuringBackupKeepsBlobsOfKilledRun(t *testing.T) {
|
|||||||
require.True(t, pruned, "the prune must run before the manifest upload")
|
require.True(t, pruned, "the prune must run before the manifest upload")
|
||||||
require.NoError(t, pruneErr)
|
require.NoError(t, pruneErr)
|
||||||
|
|
||||||
local, err := repos.Snapshots.ListRecent(ctx, listRecentTestLimit)
|
assertRetryConsistentAndRestorable(
|
||||||
require.NoError(t, err)
|
ctx, t, cfg, inner, repos, db, fs, restoreDir, testFiles)
|
||||||
require.Len(t, local, 1)
|
|
||||||
require.NoError(t, db.Close())
|
|
||||||
|
|
||||||
reader := newReaderVaultik(ctx, cfg, inner, nil, fs)
|
|
||||||
require.NoError(t, reader.Restore(&vaultik.RestoreOptions{
|
|
||||||
SnapshotID: local[0].ID.String(),
|
|
||||||
TargetDir: restoreDir,
|
|
||||||
Verify: true,
|
|
||||||
}), "a prune during the backup must not delete the blobs it rebuilt")
|
|
||||||
|
|
||||||
assertRestoredTree(t, fs, restoreDir, testFiles)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestPruneKeepsUnreferencedBlobWithNoTime checks that a blob no
|
// TestPruneKeepsUnreferencedBlobWithNoTime checks that a blob no
|
||||||
|
|||||||
Reference in New Issue
Block a user