Optimize sleep in test/systemtests
The Contiv system tests in netplugin/test/systemtests call time.Sleep() 151 times in code, many of them in loops. Due to this, the time needed to run these system tests is high. Netplugin CI needs 2.5 hours to run them.
This PR optimizes and reduces the sleeps in system tests' code in the following areas:
- Add polling code in
contivModelClient.goto poll for the status of the objectsAppProfile,EndpointGroup,Global,Network,Ruleafter creating (httpPost) and deleting (httpDelete) them. - Remove sleep in the tests and poll for the status of objects
AppProfile,EndpointGroup,Global,Network,Ruleafter creating and deleting them. - Remove unwanted sleep in code.
- Reduce sleep in code wherever needed.
- Optimize polling interval in code when checking things like:
- Node is reloaded
- Etcd and consul are restarted
- Interface is flapped
- VTEPs are verified
- ACI gateway is restarted
- Checking for the status of Netplugin after starting and stopping it
- k8s pods are deleted
Signed-off-by: Vikram Hosakote [email protected]
build PR
build PR
build PR
build PR
build PR
build PR
build PR
build PR
@vhosakot contivModelClient.go changes can't be made under vendor. You will need to make edits in the contivmodel repo or possibly back in the modelgen repo and vendor them in
build PR
build PR
build PR
build PR
build PR
build PR
build PR
build PR
Since this has taken a long time, moving it to backlog, and I'm working on other high-priority Contiv tickets.
Please do not close this PR. I'll work on it later when this PR gets higher priority.