diff --git a/integration-tests/application_tests/appUtility_test.go b/integration-tests/application_tests/appUtility_test.go index ec4dc3d035094203bfce00452b630e715c994ea2..a9cd6a726c4fbe7f3b5e9f5ac330bd0aa25f76c5 100644 --- a/integration-tests/application_tests/appUtility_test.go +++ b/integration-tests/application_tests/appUtility_test.go @@ -6,7 +6,6 @@ import ( "os/signal" "strings" "syscall" - "time" "code.fbi.h-da.de/danet/gosdn/application-framework/event" "code.fbi.h-da.de/danet/gosdn/application-framework/registration" @@ -56,7 +55,6 @@ func NewApplication(ctx context.Context, grpcClientConn *grpc.ClientConn, contro func (a *Application) Run(eventTypeCallbackTuples []event.TypeToCallbackTuple) { signal.Notify(a.stopChannel, os.Interrupt, syscall.SIGTERM) - time.Sleep(5 * time.Second) a.eventService.SubscribeToEventType(eventTypeCallbackTuples) a.eventService.SetupEventReciever(a.stopChannel) diff --git a/integration-tests/application_tests/application_test.go b/integration-tests/application_tests/application_test.go index 9a1c62a06fed3f5fbef3311eae9edfd36adc75e3..020dd62fa6a10e8f95b72691d0d2371a2b6710e3 100644 --- a/integration-tests/application_tests/application_test.go +++ b/integration-tests/application_tests/application_test.go @@ -99,8 +99,6 @@ func TestMain(m *testing.M) { if os.Getenv("RABBITMQ") == "" { _ = <-application.eventChannel _ = <-application.eventChannel - } else { - integration_test_utils.ClearRabbitMQQueues() } m.Run() diff --git a/integration-tests/integrationTestUtils/integrationTestUtils.go b/integration-tests/integrationTestUtils/integrationTestUtils.go index 7ac5ccf3b13a564180a7e8667e72fadbc34dc439..daf272f74c1cd1d30c9dd68bc76f2bf8a8f5cbef 100644 --- a/integration-tests/integrationTestUtils/integrationTestUtils.go +++ b/integration-tests/integrationTestUtils/integrationTestUtils.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "os" - "os/exec" "time" configMgmtPb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/configurationmanagement" @@ -193,38 +192,3 @@ func cleanRolesExceptAdmin(resp *apb.GetRolesResponse, roleService apb.RoleServi return nil } - -func ClearRabbitMQQueues() { - rabbitMQAddress := "localhost" - envVarRabbitmq := os.Getenv("RABBITMQ") - if envVarRabbitmq != "" { - rabbitMQAddress = envVarRabbitmq - } - - // add more queue names if necessary - queues := []string{ - "user", - "role", - "managedNetworkElement", - } - - for _, queue := range queues { - args := []string{ - "-i", - "-u", "guest:guest", - "-H", "\"content-type:application/json\"", - "-X", "POST", - "http://" + rabbitMQAddress + ":15672/api/queues/%2f/" + queue + "/get", - "-d", "{\"count\":10,\"encoding\":\"auto\",\"truncate\":50000,\"ackmode\":\"ack_requeue_false\"}", - } - - cmd := exec.Command("curl", args...) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - - err := cmd.Run() - if err != nil { - logrus.Info(err) - } - } -}