Skip to content
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

tests to cover locks and parallel execution #2551 #2552

Closed

Conversation

muayyad-alsadi
Copy link
Contributor

creates 10 containers in parallel having no image (podman rmi)
removes them in parallel

again but having the image existing before we start

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: muayyad-alsadi
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: umohnani8

If they are not already assigned, you can assign the PR to them by writing /assign @umohnani8 in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link
Collaborator

Hi @muayyad-alsadi. Thanks for your PR.

I'm waiting for a containers or openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 6, 2019
@rh-atomic-bot
Copy link
Collaborator

Can one of the admins verify this patch?
I understand the following commands:

  • bot, add author to whitelist
  • bot, test pull request
  • bot, test pull request once

@TomSweeneyRedHat
Copy link
Member

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 6, 2019
@TomSweeneyRedHat
Copy link
Member

bot, add author to whitelist

@TomSweeneyRedHat
Copy link
Member

@muayyad-alsadi thanks a bunch for the PR. I've just kicked off the tests but I don't think you've signed this PR and the test system will not be happy with that. If you indeed did not sign it, please do git commit --amend -s and repush your commit.

@@ -90,6 +90,52 @@ podman run $image java 2>&1 || echo $?
########
podman rm --all

########
Copy link
Member

Choose a reason for hiding this comment

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

Could you copy lines 83 -> 91 (run java when it's not there and clean out containers) and move that below your new section? I think we should still keep the clean out container lines 88->91 where they are, but then remove the run java when it's not there section, at lines 83->86.

If that's not clear, no worries, I'll tend to it post merge.

@TomSweeneyRedHat
Copy link
Member

@muayyad-alsadi Just to be sure you're aware, this script is only run "by hand" and is not part of the CI test system. I think it's a nice addition regardless, but if you want something to run with every PR, you'll need to work something up in the go tests that live in https://github.com/containers/libpod/tree/master/test/e2e

@baude
Copy link
Member

baude commented Mar 6, 2019

you need to sign your commit, git commit -s --amend

Signed-off-by: alsadi <alsadi@gmail.com>
# assert we have 10 running containers
count=$( podman ps -q | wc -l )
[ "x$count" == "x10" ] || { echo "was expecting 10 running containers"; exit -1; }

Copy link
Member

Choose a reason for hiding this comment

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

Well this is interesting. The following removal fails for me with:

Error: unable to find container c1: more than one result for ID or name c1: container already exists
Error: unable to find container c1: more than one result for ID or name c1: container already exists

Unless I put a several second sleep here. I then tried to changed lines 130 -> 133 with podman rmi -a -f, that seems to work, but takes a very long time, 30+ seconds of no feedback.

Adding a '-f' to the rm command on line 130 seems to make the error happen less frequently, but it's still pops from time to time.

@mheon, @vrothberg thoughts? Is this pulling up a lock issue?

Copy link
Member

Choose a reason for hiding this comment

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

Also fwiw, I stopped the script in a few places, and looked at the created containers and we'd no duplicates, so I think at least the error could use some massaging.

@muayyad-alsadi these two comments I don't suspect are an issue with your script, rather they may have found something interesting in Podman.

Copy link
Member

Choose a reason for hiding this comment

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

@TomSweeneyRedHat oh, this is an interesting one - 1 in 256 chance that we get a container ID that starts with C1, in which case we have a container c1xxxxxx... and a container with the name c1 - and rm can't tell which one we wanted to remove.

Need to check Docker for expected behavior here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this is the exact case those tests are made to catch. and I guess #2553 is also related.

it happened once, but with yesterday version of podman it did not report error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

container ID that starts with C1, in which case we have a container c1xxxxxx...

I can change it to c_1 to fix that if you like.

Copy link
Member

Choose a reason for hiding this comment

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

@muayyad-alsadi I think this might well be a bug - Docker handles this by deleting the container named c1 even if there is an ID match as well.

Copy link
Member

Choose a reason for hiding this comment

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

I think I'm going to submit a bugfix PR for this.

Copy link
Member

Choose a reason for hiding this comment

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

Opened #2563 to fix our handling of this

@openshift-ci-robot
Copy link
Collaborator

@muayyad-alsadi: The following test failed for commit a0f241b, say /retest to rerun them:

Test name Details Rerun command
ci/prow/validate link /test validate

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@muayyad-alsadi
Copy link
Contributor Author

you need to sign your commit, git commit -s --amend

@baude I did, is it ok now?

muayyad-alsadi@a67465b

@muayyad-alsadi
Copy link
Contributor Author

you'll need to work something up in the go tests that live

are those in e2e run as root or rootless?

I can add my tests there later.

@TomSweeneyRedHat
Copy link
Member

@muayyad-alsadi the e2e/tests should run as root, right @baude?

@muayyad-alsadi
Copy link
Contributor Author

the e2e/tests should run as root, right

@baude @TomSweeneyRedHat IMHO we should do rootless checks too it's one of the best values of podman. Maybe we need subsets of root test (due to limited privilege) in that case a flag might be useful.

@muayyad-alsadi muayyad-alsadi deleted the alsadi-tests-2019036 branch March 7, 2019 07:07
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants