Full restore: say to run occ upgrade before rerunning a restore that stopped after the database; remove empty spool folders of a stopped restore
This commit is contained in:
@@ -41,8 +41,8 @@ class ReadAheadTest extends TestCase {
|
||||
$this->snapshot = $repo->backupDirectory($this->src)['snapshot'];
|
||||
}
|
||||
|
||||
private function restore(ReadAheadBackend $backend, string $prefix = ''): string {
|
||||
$target = $this->tempDir();
|
||||
private function restore(ReadAheadBackend $backend, string $prefix = '', ?string $target = null): string {
|
||||
$target ??= $this->tempDir();
|
||||
$repo = Repository::openWithKey($backend, $this->keys, null, null);
|
||||
$repo->restore($this->snapshot, $target, $prefix);
|
||||
return $target;
|
||||
@@ -66,6 +66,13 @@ class ReadAheadTest extends TestCase {
|
||||
$this->assertLessThanOrEqual(count($backend->inner->list('packs')) + 1, count($backend->asked));
|
||||
}
|
||||
|
||||
public function testTheEmptySpoolOfAStoppedRestoreIsRemoved(): void {
|
||||
$target = $this->tempDir();
|
||||
mkdir("$target/.ngb-restore-spool-0badc0de", 0700); // a restore that was killed
|
||||
|
||||
$this->assertRestored($this->restore(new ReadAheadBackend(new LocalBackend($this->root)), '', $target));
|
||||
}
|
||||
|
||||
public function testARangeThatCouldNotBeReadAheadIsReadTheUsualWay(): void {
|
||||
$backend = new ReadAheadBackend(new LocalBackend($this->root), fail: [1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user