-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,52 @@ podman run $image java 2>&1 || echo $? | |
######## | ||
podman rm --all | ||
|
||
######## | ||
# pull and run many containers in parallel, test locks ..etc. | ||
######## | ||
podman rmi docker.io/library/busybox:latest > /dev/null || : | ||
for i in `seq 10` | ||
do ( podman run -d --name b$i docker.io/library/busybox:latest busybox httpd -f -p 80 )& | ||
done | ||
echo -e "\nwaiting for creation...\n" | ||
wait | ||
echo -e "\ndone\n" | ||
# assert we have 10 running containers | ||
count=$( podman ps -q | wc -l ) | ||
[ "x$count" == "x10" ] || { echo "was expecting 10 running containers"; exit -1; } | ||
|
||
for i in `seq 10`; do ( podman stop -t=1 b$i; podman rm b$i )& done | ||
echo -e "\nwaiting for deletion...\n" | ||
wait | ||
echo -e "\ndone\n" | ||
# assert we have 0 running containers | ||
count=$( podman ps -q | wc -l ) | ||
[ "x$count" == "x0" ] || { echo "was expecting 0 running containers"; exit -1; } | ||
|
||
|
||
######## | ||
# run many containers in parallel for an existing image, test locks ..etc. | ||
######## | ||
podman pull docker.io/library/busybox:latest > /dev/null || : | ||
for i in `seq 10` | ||
do ( podman run -d --name c$i docker.io/library/busybox:latest busybox httpd -f -p 80 )& | ||
done | ||
echo -e "\nwaiting for creation...\n" | ||
wait | ||
echo -e "\ndone\n" | ||
# assert we have 10 running containers | ||
count=$( podman ps -q | wc -l ) | ||
[ "x$count" == "x10" ] || { echo "was expecting 10 running containers"; exit -1; } | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well this is interesting. The following removal fails for me with:
Unless I put a several second sleep here. I then tried to changed lines 130 -> 133 with 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Need to check Docker for expected behavior here. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can change it to c_1 to fix that if you like. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'm going to submit a bugfix PR for this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opened #2563 to fix our handling of this |
||
for i in `seq 10`; do ( podman stop -t=1 c$i; podman rm c$i )& done | ||
echo -e "\nwaiting for deletion...\n" | ||
wait | ||
echo -e "\ndone\n" | ||
# assert we have 0 running containers | ||
count=$( podman ps -q | wc -l ) | ||
[ "x$count" == "x0" ] || { echo "was expecting 0 running containers"; exit -1; } | ||
|
||
|
||
######## | ||
# Install java onto the container, commit it, then run it showing java usage | ||
######## | ||
|
There was a problem hiding this comment.
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.