Skip to content

integration: wait for service update to be completed#38474

Closed
thaJeztah wants to merge 3 commits intomoby:masterfrom
thaJeztah:change_serviceIsUpdated
Closed

integration: wait for service update to be completed#38474
thaJeztah wants to merge 3 commits intomoby:masterfrom
thaJeztah:change_serviceIsUpdated

Conversation

@thaJeztah
Copy link
Member

Wondering if this is the cause for TestServiceUpdateConfigs to be flaky; this code was added as part of #37564, and appeared to be flaky on the PR itself #37564 (comment)

07:40:41 --- FAIL: TestServiceUpdateConfigs (2.90s)
07:40:41     daemon.go:296: [d954a5785d31c] waiting for daemon to start
07:40:41     daemon.go:328: [d954a5785d31c] daemon started
07:40:41     update_test.go:188: assertion failed: error is not nil: Error response from daemon: rpc error: code = Unknown desc = update out of sequence
07:40:41     daemon.go:283: [d954a5785d31c] exiting daemon
07:40:41 FAIL
07:40:41 ---> Making bundle: .integration-daemon-stop (in bundles/test-integration)
07:40:44 Clearing AppArmor profiles cache:.

relates to #37547

@thaJeztah
Copy link
Member Author

/cc @adshmh @kolyshkin @vdemeester

I couldn't find a reference why nil was also considered "service is converged", so perhaps this is not the right change; it just stood out a bit, so wondering if this was correct.

@thaJeztah thaJeztah force-pushed the change_serviceIsUpdated branch from c0c0dca to 75624b9 Compare January 2, 2019 14:15
@codecov
Copy link

codecov bot commented Jan 2, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@de640c9). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #38474   +/-   ##
=========================================
  Coverage          ?   36.63%           
=========================================
  Files             ?      608           
  Lines             ?    45174           
  Branches          ?        0           
=========================================
  Hits              ?    16550           
  Misses            ?    26336           
  Partials          ?     2288

@thaJeztah
Copy link
Member Author

ok, that doesn't seem to work indeed;

14:23:13 === RUN   TestServiceUpdateLabel
14:23:45 --- FAIL: TestServiceUpdateLabel (31.85s)
14:23:45     daemon.go:296: [d0cbb2acf2c65] waiting for daemon to start
14:23:45     daemon.go:328: [d0cbb2acf2c65] daemon started
14:23:45     update_test.go:35: timeout hit after 30s: waiting for service qsdarx3yw9unpnkxgik5yco84 to be updated
14:23:45     daemon.go:283: [d0cbb2acf2c65] exiting daemon

vdemeester
vdemeester previously approved these changes Jan 3, 2019
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@vdemeester vdemeester dismissed their stale review January 3, 2019 09:56

Actually… CI is failing

@vdemeester
Copy link
Member

Looking at the failure

14:36:48 === RUN   TestServiceUpdateLabel
14:37:20 --- FAIL: TestServiceUpdateLabel (31.93s)
14:37:20     daemon.go:296: [d78c00ad8edaf] waiting for daemon to start
14:37:20     daemon.go:328: [d78c00ad8edaf] daemon started
14:37:20     update_test.go:35: timeout hit after 30s: waiting for service l8u8xz2frkylmuzwyrlf0wjnx to be updated
14:37:20     daemon.go:283: [d78c00ad8edaf] exiting daemon

Maybe, UpdateStatus is not updated in some cases (like updating labels as it might only update the spec and no desired state change)

@thaJeztah
Copy link
Member Author

thaJeztah commented Jan 3, 2019

Maybe, UpdateStatus is not updated in some cases (like updating labels as it might only update the spec and no desired state change)

@vdemeester Yes, that's what I was thinking as well. I'd have to check with the SwarmKit people; I think that may be troublesome if for some updates we have to wait for it to reach UpdateStateCompleted, and for other updates we're ok with it being nil.

(Without having dug into it); wondering if the flakiness in the TestServiceUpdateConfigs case is that for that test we actually want it to reach UpdateStateCompleted and it goes something like;

  • (A) Service status becomes UpdateStatus = nil
    • we think it completed (but it's actually still in the process of updating)
  • (B) Service status becomes UpdateStatus = UpdateStateCompleted
    • it actually completed, and version is incremented
  • (C) we update the service again (using the old version from (A))
  • (D) test fails ("update out of sequence"), because version from (A) was not the last version; we should've used the version from (B).

@thaJeztah
Copy link
Member Author

ping @aaronlehmann @dperny @anshulpundir could you have a look at this? Wondering if you know if my suspicion above could be right 🤗

@olljanat
Copy link
Contributor

olljanat commented Jan 3, 2019

@thaJeztah afaik, updating only service specs does no actually generate update tasks.
How about if we also update/add some container labels with it?

Another thing which I was thinking that how much of these tests actually should be on here and how much on Swarmkit side?

@thaJeztah
Copy link
Member Author

Perhaps the issue is that ServiceCreate is asynchronous, so will return immediately, however, the service's tasks are not yet running/converged. Once they converge, the Version may be updated 🤔

Do we need something like is done on the CLI; https://github.com/docker/cli/blob/ae1618713f83e7da07317d579d0675f578de22fa/cli/command/service/progress/progress.go#L75-L205 and https://github.com/docker/cli/blob/ae1618713f83e7da07317d579d0675f578de22fa/cli/command/service/progress/progress.go#L273-L330 ?

@thaJeztah
Copy link
Member Author

Another thing which I was thinking that how much of these tests actually should be on here and how much on Swarmkit side?

That's a good question; I do think we need some integration tests here (as this is the integration point of swarmkit into docker); not sure we need all of them

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the change_serviceIsUpdated branch from 75624b9 to dc70637 Compare January 4, 2019 15:48
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@olljanat
Copy link
Contributor

olljanat commented Jan 9, 2019

Closing as #38499 got merged

@derek derek bot closed this Jan 9, 2019
@thaJeztah thaJeztah deleted the change_serviceIsUpdated branch January 9, 2019 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants