Fix for Flaky test TestServiceWithPredefinedNetwork#36551
Fix for Flaky test TestServiceWithPredefinedNetwork#36551vdemeester merged 1 commit intomoby:masterfrom
Conversation
dnephin
left a comment
There was a problem hiding this comment.
There seems to be a couple problems with this test.
-
It's not actually checking anything about the service, just that it exists. Shouldn't it be comparing the inspect result to the expected?
-
It shouldn't be doing cleanup. That is handled by
setupTest(t)().
What is the purpose of this test? What is the host network a special case? That is what needs to be checked.
integration/network/service_test.go
Outdated
There was a problem hiding this comment.
Removing this is not the correct fix. It should be used as a filter in ServiceList.
There was a problem hiding this comment.
- The actual regression issue was we couldnt create service with host network. Thats what I tried to test it to make sure there is no issue in creating service with host network.
- For your clean up comment : I try to remove service and make sure service is getting cleared. Thats what I meant by cleanup. I am not doing anything extra. Do you suggest I dont need to do verify the service that I created whether I am able to remove or not?. Pls let me know your feedback on this.
3)Regarding not adding filter: I am trying to get all the services running. so looked into existing examples of functions calling serviceList API. none of them using filter. Your previous comment on original comment said , I have defined filter but not using it. So i wanted to clean up the code as part of your previous comment. Pls correct me if my understand is wrong.
There was a problem hiding this comment.
I try to remove service and make sure service is getting cleared. Thats what I meant by cleanup. I am not doing anything extra. Do you suggest I dont need to do verify the service that I created whether I am able to remove or not?. Pls let me know your feedback on this.
That's right. The daemon which runs this service is going to be shutdown when the test exits (defer d.Stop(t)) so you don't need to spend time doing cleanup.
Regarding not adding filter: I am trying to get all the services running.
Ok, I guess this is ok since you're targeting a daemon that was launched for this test.
|
@selansen this needs a minor rebase |
|
should I pull latest moby and apply my change on top of it and submit again
?
…On Wed, Mar 14, 2018 at 3:09 PM, Sebastiaan van Stijn < ***@***.***> wrote:
@selansen <https://github.com/selansen> this needs a minor rebase
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#36551 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKEKn0xiI-xgk123GyuyL1U_e-zfgZ2Fks5teWrZgaJpZM4Sk8aV>
.
|
Codecov Report
@@ Coverage Diff @@
## master #36551 +/- ##
=========================================
Coverage ? 34.76%
=========================================
Files ? 612
Lines ? 45577
Branches ? 0
=========================================
Hits ? 15844
Misses ? 27663
Partials ? 2070 |
You should fetch the latest code then make your topic branch |
|
Thats what I did and committed my changes. Looks like all sanity passed. |
|
Seems the symptom of |
|
Yes. taken care of that too |
|
@thaJeztah , Hope this helps flaky issue that we are seeing on selective target. |
|
|
integration/network/service_test.go
Outdated
There was a problem hiding this comment.
Erm, this function doesn't seem to be called?
There was a problem hiding this comment.
I kept the new API so that TestServiceWithIngressNetwork will call it. Let me update it.
integration/network/service_test.go
Outdated
There was a problem hiding this comment.
If we don't check if the service (plus tasks?) are all removed here, this test may not be testing what it was created for (i.e.: check that the ingress network is not removed when removing services)
There was a problem hiding this comment.
Idea was to check service is removed instead task as we are testing service create/remove. Thats why I added new API. Let me update TestServiceWithIngressNetwork. Thanks for pointing it out.
There was a problem hiding this comment.
BTW actual test that was written by Chris Telfer was to verify Ingress network absence after service remove. So test will fail if it is not met. Daniel mentioned service clean up will happen automatically when we tear down the swarm . so we dont need to check this explicitly. Anyways I update the with new API that TestServiceWithIngressNetwork with my newly added noServices check to make sure we cover that .
|
Failed test cases are not related to my test cases. |
|
Seems |
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM, but needs a rebase (looks like because of the gotestyourself changes)
|
@thaJeztah , I just did a rebase. should be good to go. |
TestServiceWithPredefinedNetwork test case was failing at times. To fix the issue, added new API to check for services after we clean up all services. Tested multiple times and this sould fix flaky issue. Signed-off-by: selansen <elango.siva@docker.com>
|
Thanks! moved it to "status/merge" - fingers crossed if it all goes green 👍 |
|
Hm, more flakiness? |
|
These tests pass now though; |
|
Not sure about docker_api_swarm_service_test. They are not related to the fix I did. May be we need to take it as separate issue. |
Fixes #36547
Signed-off-by: selansen elango.siva@docker.com
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)