Stopping OLT gRPC server only after all indications have been sent
Change-Id: I9de1bd5783fad5fa96b50e48dcb973506b841a49
diff --git a/internal/bbsim/devices/olt.go b/internal/bbsim/devices/olt.go
index 746a58b..305a7ce 100644
--- a/internal/bbsim/devices/olt.go
+++ b/internal/bbsim/devices/olt.go
@@ -309,9 +309,6 @@
return err
}
- time.Sleep(1 * time.Second) // we need to give the OLT the time to respond to all the pending gRPC request before stopping the server
- o.StopOltServer()
-
if softReboot {
for _, pon := range o.Pons {
if pon.InternalState.Current() == "enabled" {
@@ -341,11 +338,13 @@
}
}
+ time.Sleep(1 * time.Second) // we need to give the OLT the time to respond to all the pending gRPC request before stopping the server
+ o.StopOltServer()
+
// terminate the OLT's processOltMessages go routine
close(o.channel)
o.enableContextCancel()
-
time.Sleep(time.Duration(rebootDelay) * time.Second)
if err := o.InternalState.Event("initialize"); err != nil {