From 3801e59475d92d036ed05ade3d6b6c76a3feb4bb Mon Sep 17 00:00:00 2001 From: chaitalisg Date: Wed, 3 Jul 2024 20:34:50 -0700 Subject: [PATCH] test(general): run maintenance action in robustness (#3927) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- .../multiclient_test/multiclient_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/robustness/multiclient_test/multiclient_test.go b/tests/robustness/multiclient_test/multiclient_test.go index 4a5de500f..5047db873 100644 --- a/tests/robustness/multiclient_test/multiclient_test.go +++ b/tests/robustness/multiclient_test/multiclient_test.go @@ -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)