Skip to content

fix unless-stopped unexpected behavior#35355

Merged
vdemeester merged 1 commit intomoby:masterfrom
x1022as:unless-stop
Feb 4, 2019
Merged

fix unless-stopped unexpected behavior#35355
vdemeester merged 1 commit intomoby:masterfrom
x1022as:unless-stop

Conversation

@x1022as
Copy link
Contributor

@x1022as x1022as commented Nov 1, 2017

fix #35304 restart=unless-stopped not working as expected

Signed-off-by: Deng Guangxing [email protected]

- 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)

Copy link
Contributor

@boaz0 boaz0 left a comment

Choose a reason for hiding this comment

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

We are not writing new tests to integration-cli.

@x1022as
Copy link
Contributor Author

x1022as commented Nov 1, 2017

@ripcurld0 where should I add tests to?

@boaz0
Copy link
Contributor

boaz0 commented Nov 1, 2017

in your repository there is the integration directory, under it there is the container directory where we are writing integration tests to containers. For example, create_test.go has all the tests related of creating a new container.

I guess you can look at create_test.go and rename_test.go to see the API and create a new file kill_test.go or add another test function to create_test.go that runs the same scenario you described in the issue.

cc @dnephin and @vdemeester

@dnephin
Copy link
Member

dnephin commented Nov 1, 2017

Is there maybe already a test case for this behaviour that can be fixed to catch the problem? This is a one line fix, so I wonder if it really needs an entirely new integration test case.

@x1022as
Copy link
Contributor Author

x1022as commented Nov 2, 2017

@dnephin yes, I can add this test to TestDaemonRestartUnlessStopped in integration-cli/docker_cli_daemon_test.go, is this acceptable?

@dnephin
Copy link
Member

dnephin commented Nov 2, 2017

Yes, adding another container there sounds good

@x1022as
Copy link
Contributor Author

x1022as commented Nov 3, 2017

Test case would fail occasionally, need some deep dig :(

@x1022as x1022as force-pushed the unless-stop branch 3 times, most recently from a1f17f6 to e347aa8 Compare November 10, 2017 09:55
@thaJeztah
Copy link
Member

@x1022as whats the status on this one? Is this ready for review again?

@x1022as
Copy link
Contributor Author

x1022as commented Dec 10, 2017

@thaJeztah sorry for late response.
jenkins's passed, ready for review:)

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 🤔

daemon/start.go Outdated
Copy link
Member

Choose a reason for hiding this comment

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

What's the reasoning behind changing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't know which one of kill and 'libcontainerd.ExitEvent' comes first.

containerStart() in exitEvent should not overwrite HasBeenManuallyStopped in such case

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@d440fea). Click here to learn what that means.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master   #35355   +/-   ##
=========================================
  Coverage          ?   36.62%           
=========================================
  Files             ?      610           
  Lines             ?    45238           
  Branches          ?        0           
=========================================
  Hits              ?    16569           
  Misses            ?    26390           
  Partials          ?     2279

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

restart=unless-stopped not working as expected

8 participants