-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize sleep in test/systemtests #1037
base: master
Are you sure you want to change the base?
Conversation
build PR |
1 similar comment
build PR |
build PR |
5 similar comments
build PR |
build PR |
build PR |
build PR |
build PR |
@vhosakot |
build PR |
@@ -510,19 +508,15 @@ func (s *systemtestSuite) TestBgpTriggerNetpluginRestart(c *C) { | |||
for _, node := range s.nodes { | |||
var err error | |||
c.Assert(node.stopNetplugin(), IsNil) | |||
logrus.Info("Sleeping for a while to wait for netplugin's TTLs to expire") | |||
time.Sleep(1 * time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires some checks to ensure whatever is meant to expire has expired. We can't remove these two sleep calls without ensuring the relevant TTL has expired. The BGP tests run into some failures right now.
@@ -626,8 +620,7 @@ func (s *systemtestSuite) TestBgpMultiTrigger(c *C) { | |||
) | |||
iter++ | |||
c.Assert(nodeToStop.stopNetplugin(), IsNil) | |||
logrus.Info("Sleeping for a while to wait for netplugin's TTLs to expire") | |||
time.Sleep(2 * time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires some checks to ensure the TTL has expired as well.
@@ -735,12 +730,10 @@ func (s systemtestSuite) testServiceTriggerNetpluginRestart(c *C, encap string) | |||
} | |||
} | |||
c.Assert(node.stopNetplugin(), IsNil) | |||
logrus.Info("Sleeping for a while to wait for netplugin's TTLs to expire") | |||
time.Sleep(2 * time.Minute) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is similar - it needs some checks to ensure the TTLs have expired.
build PR |
3 similar comments
build PR |
build PR |
build PR |
Signed-off-by: Vikram Hosakote <[email protected]>
Signed-off-by: Vikram Hosakote <[email protected]>
Signed-off-by: Vikram Hosakote <[email protected]>
Signed-off-by: Vikram Hosakote <[email protected]>
Signed-off-by: Vikram Hosakote <[email protected]>
Signed-off-by: Vikram Hosakote <[email protected]>
Signed-off-by: Vikram Hosakote <[email protected]>
Signed-off-by: Vikram Hosakote <[email protected]>
build PR |
Signed-off-by: Vikram Hosakote <[email protected]>
build PR |
Signed-off-by: Vikram Hosakote <[email protected]>
build PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the poller logic should be in testing codes instead of client codes, and also can be a function with a func pointer (of get method, if possible) passed as a parameter, this would save some efforts on adding such function for each object.
also the checkListener loops, inspect loops might be all benefits from such util func
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. |
The Contiv system tests in
netplugin/test/systemtests
calltime.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:
contivModelClient.go
to poll for the status of the objectsAppProfile
,EndpointGroup
,Global
,Network
,Rule
after creating (httpPost
) and deleting (httpDelete
) them.AppProfile
,EndpointGroup
,Global
,Network
,Rule
after creating and deleting them.Signed-off-by: Vikram Hosakote [email protected]