test(general): run maintenance action in robustness (#3927)

Adds the maintenance action to multi-client robustness jobs.
The robustness jobs do not run a maintenance action until now.
---------
Co-authored-by: Julio López <1953782+julio-lopez@users.noreply.github.com>
This commit is contained in:
chaitalisg
2024-07-03 20:34:50 -07:00
committed by GitHub
parent a861f763dc
commit 3801e59475

View File

@@ -190,6 +190,21 @@ func TestRandomizedSmall(t *testing.T) {
th.RunN(ctx, t, numClients, f)
}
func TestMaintenanceAction(t *testing.T) {
t.Log("running maintenance directly on the repository under test")
// bypass the server to directly run maintenance on the repository
// under test.
// It launches a kopia process that directly accesses the repository
// under test using the repo configuration for the server. The
// server is concurrently running, since the framework starts
// the server at the beginning of an execution of the framework.
ctx := testlogging.ContextWithLevel(t, testlogging.LevelInfo)
_, err := eng.ExecAction(ctx, engine.GCActionKey, nil)
require.NoError(t, err)
}
// tryRestoreIntoDataDirectory runs eng.ExecAction on the given parameters and masks no-op errors.
func tryRestoreIntoDataDirectory(ctx context.Context, t *testing.T) error { //nolint:thelper
_, err := eng.ExecAction(ctx, engine.RestoreIntoDataDirectoryActionKey, nil)