chore: misc bug fixes supporting sqlite migration (#517)

This commit is contained in:
Gareth
2024-10-13 17:55:37 -07:00
committed by GitHub
parent 28c31720f2
commit 0daa74f04f
31 changed files with 508 additions and 263 deletions

View File

@@ -559,6 +559,12 @@ func TestHookOnErrorHandling(t *testing.T) {
func TestCancelBackup(t *testing.T) {
t.Parallel()
// a hook is used to make the backup operation wait long enough to be cancelled
hookCmd := "sleep 2"
if runtime.GOOS == "windows" {
hookCmd = "Start-Sleep -Seconds 2"
}
sut := createSystemUnderTest(t, &config.MemoryStore{
Config: &v1.Config{
Modno: 1234,
@@ -586,6 +592,18 @@ func TestCancelBackup(t *testing.T) {
PolicyKeepLastN: 1,
},
},
Hooks: []*v1.Hook{
{
Conditions: []v1.Hook_Condition{
v1.Hook_CONDITION_SNAPSHOT_START,
},
Action: &v1.Hook_ActionCommand{
ActionCommand: &v1.Hook_Command{
Command: hookCmd,
},
},
},
},
},
},
},
@@ -629,7 +647,7 @@ func TestCancelBackup(t *testing.T) {
})
if err := errgroup.Wait(); err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
// Assert that the backup operation was cancelled