Skip to content
Snippets Groups Projects
Commit 71f797e0 authored by Fabian Seidl's avatar Fabian Seidl
Browse files

test ci, delay for subscribe recievers

parent f00733bb
No related branches found
No related tags found
1 merge request!691Resolve "Implement integration tests for applications"
Pipeline #178216 failed
This commit is part of merge request !691. Comments created here will be created in the context of that merge request.
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"os/signal" "os/signal"
"strings" "strings"
"syscall" "syscall"
"time"
"code.fbi.h-da.de/danet/gosdn/application-framework/event" "code.fbi.h-da.de/danet/gosdn/application-framework/event"
"code.fbi.h-da.de/danet/gosdn/application-framework/registration" "code.fbi.h-da.de/danet/gosdn/application-framework/registration"
...@@ -47,7 +48,7 @@ func NewApplication(ctx context.Context, grpcClientConn *grpc.ClientConn, contro ...@@ -47,7 +48,7 @@ func NewApplication(ctx context.Context, grpcClientConn *grpc.ClientConn, contro
eventService: eventService, eventService: eventService,
stopChannel: make(chan os.Signal, 1), stopChannel: make(chan os.Signal, 1),
grpcClientConn: grpcClientConn, grpcClientConn: grpcClientConn,
eventChannel: make(chan event.Event, 100), eventChannel: make(chan event.Event, 1),
} }
} }
...@@ -55,6 +56,7 @@ func NewApplication(ctx context.Context, grpcClientConn *grpc.ClientConn, contro ...@@ -55,6 +56,7 @@ func NewApplication(ctx context.Context, grpcClientConn *grpc.ClientConn, contro
func (a *Application) Run(eventTypeCallbackTuples []event.TypeToCallbackTuple) { func (a *Application) Run(eventTypeCallbackTuples []event.TypeToCallbackTuple) {
signal.Notify(a.stopChannel, os.Interrupt, syscall.SIGTERM) signal.Notify(a.stopChannel, os.Interrupt, syscall.SIGTERM)
time.Sleep(5 * time.Second)
a.eventService.SubscribeToEventType(eventTypeCallbackTuples) a.eventService.SubscribeToEventType(eventTypeCallbackTuples)
a.eventService.SetupEventReciever(a.stopChannel) a.eventService.SetupEventReciever(a.stopChannel)
......
...@@ -59,8 +59,8 @@ func TestMain(m *testing.M) { ...@@ -59,8 +59,8 @@ func TestMain(m *testing.M) {
fmt.Println(err.Error()) fmt.Println(err.Error())
} }
// integration_test_utils.ApplySDNConfig(conn, ctx, defaultSDNConfig) defer integration_test_utils.ApplySDNConfig(conn, ctx, defaultSDNConfig)
// integration_test_utils.CleanUserAndRolesExceptAdmin(conn, ctx) defer integration_test_utils.CleanUserAndRolesExceptAdmin(conn, ctx)
topics := []event.Topic{event.ManagedNetworkElement, event.User} topics := []event.Topic{event.ManagedNetworkElement, event.User}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment