ResetTestFlag bool
Counters map[string]xapp.Counter
LoggerLevel uint32
+ UTTesting bool
}
type RMRMeid struct {
// Read subscriptions from db
c.ReadE2Subscriptions()
c.ReadRESTSubscriptions()
-
- /*
- xapp.Logger.Info("Reading subscriptions from db")
- subIds, register, err := c.ReadAllSubscriptionsFromSdl()
- if err != nil {
- xapp.Logger.Error("%v", err)
- } else {
- c.registry.subIds = subIds
- c.registry.register = register
- c.HandleUncompletedSubscriptions(register)
- }
-
- restSubscriptions, err := c.ReadAllRESTSubscriptionsFromSdl()
- if err != nil {
- xapp.Logger.Error("%v", err)
- } else {
- c.registry.restSubscriptions = restSubscriptions
- }
- */
return c
}
func (c *Control) processSubscriptionRequests(restSubscription *RESTSubscription, subReqList *e2ap.SubscriptionRequestList,
clientEndpoint *models.SubscriptionParamsClientEndpoint, meid *string, restSubId *string, xAppRmrEndpoint string, md5sum string) {
- xapp.Logger.Info("Subscription Request count=%v ", len(subReqList.E2APSubscriptionRequests))
+ c.SubscriptionProcessingStartDelay()
+ xapp.Logger.Debug("Subscription Request count=%v ", len(subReqList.E2APSubscriptionRequests))
var xAppEventInstanceID int64
var e2EventInstanceID int64
}
}
+//-------------------------------------------------------------------
+//
+//------------------------------------------------------------------
+func (c *Control) SubscriptionProcessingStartDelay() {
+ if c.UTTesting == true {
+ // This is temporary fix for the UT problem that notification arrives before subscription response
+ // Correct fix would be to allow notification come before response and process it correctly
+ xapp.Logger.Debug("Setting 50 ms delay before starting processing Subscriptions")
+ <-time.After(time.Millisecond * 50)
+ xapp.Logger.Debug("Continuing after delay")
+ }
+}
+
//-------------------------------------------------------------------
//
//------------------------------------------------------------------