Skip to content

Use check in params so we don't ignore errors#29224

Merged
thaJeztah merged 2 commits intomoby:masterfrom
vdemeester:check-no-errors
Dec 8, 2016
Merged

Use check in params so we don't ignore errors#29224
thaJeztah merged 2 commits intomoby:masterfrom
vdemeester:check-no-errors

Conversation

@vdemeester
Copy link
Copy Markdown
Member

@vdemeester vdemeester commented Dec 7, 2016

Small improvements mainly on the TearDownTest for the suite(s) so we make sure to not ignore some errors.

/cc @cpuguy83 @dnephin @icecrime @thaJeztah @AkihiroSuda @vieux @tiborvass

🐻

Signed-off-by: Vincent Demeester [email protected]

@AkihiroSuda AkihiroSuda added the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 8, 2016
Comment thread integration-cli/docker_utils.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

plugin remove doesn't answer http.StatusNoContent (maybe it should but it does not)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should fix that if it doesn't return content /cc @anusha-ragunathan

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, best practice could be to check for "any" 2xx status code

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can add a TODO 👼

Comment thread integration-cli/docker_utils.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This make sure it will also delete image like imageName:<none> which are generated on some DockerRegistrySuite tests. There was some left overs, and as we ignored the errors, we didn't even know it…

@vdemeester vdemeester removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 8, 2016
@vdemeester
Copy link
Copy Markdown
Member Author

It showed some errors that weren't catched… updates should fix them 👼

deleteAllImages(c)
deleteAllVolumes(c)
deleteAllNetworks(c)
if daemonPlatform == "linux" {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Plugins aren't supported by windows (and possibly other daemon platform), so we should try to clean them on those.

@vdemeester vdemeester force-pushed the check-no-errors branch 2 times, most recently from eca1039 to 5580052 Compare December 8, 2016 15:28
@vdemeester vdemeester added the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 8, 2016
Signed-off-by: Vincent Demeester <[email protected]>
@vdemeester vdemeester removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Dec 8, 2016
fmt.Printf("ERROR: couldn't resolve full path to the Docker binary (%v)\n", err)
os.Exit(1)
}
if registryImage := os.Getenv("REGISTRY_IMAGE"); registryImage != "" {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we know why this was there?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not really, but it's dead code 😅

c.Assert(out, checker.Contains, id[:12], check.Commentf("container should be restarted instead of removed: %v", out))

// Kill the container to make sure it will be removed
dockerCmd(c, "kill", id)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this needed now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So, this tests is making sure a container started with --rm will not be removed when doing a restart one it. This means, when TearDown gets there, it's failing with Removal in progress. By killing it before, I make sure it's getting cleaned before.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. Ideally docker rm should just wait until the removal finishes instead of erroring, but that's a different issue.

@tonistiigi
Copy link
Copy Markdown
Member

LGTM


func deleteAllImages() error {
cmd := exec.Command(dockerBinary, "images")
func deleteAllImages(c *check.C) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As a follow up, we should use docker image prune -af 😄

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 7ea31b4 into moby:master Dec 8, 2016
@GordonTheTurtle GordonTheTurtle added this to the 1.14.0 milestone Dec 8, 2016
@vdemeester vdemeester deleted the check-no-errors branch December 8, 2016 23:32
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.

5 participants