X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fut_ctrl_submgr_test.go;h=dadf42fb7f34b830a0f95af3519f27bfd8173694;hb=refs%2Fchanges%2F47%2F7347%2F1;hp=31eed311916ff7026d46587440e8d784cf228c19;hpb=54838ed6fb79821c3711f92876993264d358f2c3;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/ut_ctrl_submgr_test.go b/pkg/control/ut_ctrl_submgr_test.go index 31eed31..dadf42f 100644 --- a/pkg/control/ut_ctrl_submgr_test.go +++ b/pkg/control/ut_ctrl_submgr_test.go @@ -297,8 +297,8 @@ func (mc *testingSubmgrControl) VerifyAllClean(t *testing.T) { break } } + xapp.Logger.Debug("VerifyAllClean. Adding 100ms more delay to complete") <-time.After(time.Millisecond * 100) - mc.TestLog(t, "VerifyAllClean delay plus 100ms") } assert.Equal(t, 0, len(mainCtrl.c.registry.register)) @@ -313,6 +313,25 @@ func (mc *testingSubmgrControl) VerifyAllClean(t *testing.T) { verifyE2KeyCount(t, 0) } +func (mc *testingSubmgrControl) WaitOngoingRequestMapEmpty() { + for i := 0; i < 100; i++ { + if len(mainCtrl.c.restDuplicateCtrl.ongoingRequestMap) != 0 { + <-time.After(time.Millisecond * 100) + xapp.Logger.Debug("WaitOngoingRequestMapEmpty. Adding 100ms more delay to complete") + } + } +} + +func (mc *testingSubmgrControl) WaitRESTSubscriptionDelete(restSubsId string) { + for i := 0; i < 100; i++ { + restSubscription, _ := mainCtrl.c.registry.GetRESTSubscription(restSubsId, false) + if restSubscription != nil { + xapp.Logger.Debug("WaitRESTSubscriptionDelete. Adding 100ms more delay to complete") + <-time.After(time.Millisecond * 100) + } + } +} + func (mc *testingSubmgrControl) GetMetrics(t *testing.T) (string, error) { req, err := http.NewRequest("GET", "http://localhost:8080/ric/v1/metrics", nil) if err != nil {