From 5fc627f2d7eb465a5e0e0d8da2254fdcd3a562a5 Mon Sep 17 00:00:00 2001 From: Soyeon Park Date: Fri, 13 Sep 2024 18:42:21 +0900 Subject: [PATCH] bugfix: CIFuzz fail due to timeout on FuzzProcessExperimentRunDelete Signed-off-by: Soyeon Park --- .../fuzz_tests/service_fuzz_test.go | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/chaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.go b/chaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.go index 5ae50c6ef7b..31ff3b9aa5f 100644 --- a/chaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.go +++ b/chaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.go @@ -12,7 +12,6 @@ import ( fuzz "github.com/AdaLogics/go-fuzz-headers" store "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/data-store" - "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb" "github.com/stretchr/testify/mock" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" @@ -47,39 +46,6 @@ func NewMockServices() *MockServices { } } -func FuzzProcessExperimentRunDelete(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - fuzzConsumer := fuzz.NewConsumer(data) - targetStruct := &struct { - Query bson.D - WorkflowRunID *string - ExperimentRun dbChaosExperimentRun.ChaosExperimentRun - Workflow dbChaosExperiment.ChaosExperimentRequest - Username string - StoreStateData *store.StateData - }{} - err := fuzzConsumer.GenerateStruct(targetStruct) - if err != nil { - return - } - mockServices := NewMockServices() - mockServices.MongodbOperator.On("Update", mock.Anything, mongodb.ChaosExperimentRunsCollection, mock.Anything, mock.Anything, mock.Anything).Return(&mongo.UpdateResult{}, nil).Once() - - err = mockServices.ChaosExperimentRunService.ProcessExperimentRunDelete( - context.Background(), - targetStruct.Query, - targetStruct.WorkflowRunID, - targetStruct.ExperimentRun, - targetStruct.Workflow, - targetStruct.Username, - targetStruct.StoreStateData, - ) - if err != nil { - t.Errorf("ProcessExperimentRunDelete() error = %v", err) - } - }) -} - func FuzzProcessExperimentRunStop(f *testing.F) { f.Fuzz(func(t *testing.T, data []byte) { fuzzConsumer := fuzz.NewConsumer(data)