From 0fced48f72a5135e7f27f798d8c5df805f90d19b Mon Sep 17 00:00:00 2001 From: guy-har Date: Thu, 18 Jul 2024 14:16:38 +0300 Subject: [PATCH] Reduce abuse amount and parallelism in abuse test (#7996) --- esti/lakectl_test.go | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/esti/lakectl_test.go b/esti/lakectl_test.go index 6f869c5ca00..7ebc40658e9 100644 --- a/esti/lakectl_test.go +++ b/esti/lakectl_test.go @@ -861,6 +861,7 @@ func TestLakectlBranchProtection(t *testing.T) { RunCmdAndVerifySuccessWithFile(t, Lakectl()+" branch-protect list lakefs://"+repoName, false, "lakectl_branch_protection_list.term", vars) } +// TestLakectlAbuse runs a series of abuse commands to test the functionality of lakectl abuse (not in order to test how lakeFS handles abuse) func TestLakectlAbuse(t *testing.T) { repoName := generateUniqueRepositoryName() storage := generateUniqueStorageNamespace(repoName) @@ -884,6 +885,10 @@ func TestLakectlAbuse(t *testing.T) { require.NoError(t, err) require.NoError(t, f.Close()) + const ( + abuseAmount = 50 + abuseParallelism = 3 + ) tests := []struct { Cmd string Amount int @@ -894,30 +899,34 @@ func TestLakectlAbuse(t *testing.T) { Amount: 10, }, { - Cmd: "create-branches", - Amount: 1000, + Cmd: "create-branches", + Amount: abuseAmount, + AdditionalArgs: fmt.Sprintf("--parallelism %d", abuseParallelism), }, { - Cmd: "link-same-object", - Amount: 1000, + Cmd: "link-same-object", + Amount: abuseAmount, + AdditionalArgs: fmt.Sprintf("--parallelism %d", abuseParallelism), }, { - Cmd: "list", - Amount: 1000, + Cmd: "list", + Amount: abuseAmount, + AdditionalArgs: fmt.Sprintf("--parallelism %d", abuseParallelism), }, { Cmd: "random-read", - Amount: 1000, - AdditionalArgs: "--from-file " + f.Name(), + Amount: abuseAmount, + AdditionalArgs: fmt.Sprintf("--parallelism %d --from-file %s", abuseParallelism, f.Name()), }, { Cmd: "random-delete", - Amount: 1000, - AdditionalArgs: "--from-file " + f.Name(), + Amount: abuseAmount, + AdditionalArgs: fmt.Sprintf("--parallelism %d --from-file %s", abuseParallelism, f.Name()), }, { - Cmd: "random-write", - Amount: 1000, + Cmd: "random-write", + Amount: abuseAmount, + AdditionalArgs: fmt.Sprintf("--parallelism %d", abuseParallelism), }, } for _, tt := range tests {