Skip to content

Commit

Permalink
test: add no-pull-on-run=true
Browse files Browse the repository at this point in the history
This builds on commit 35f6461.

crictl 1.19 added these options in [1].

First, set no-pull-on-run, which should eliminate flakes like this one:

> `ctr_id=$(crictl run "$TESTDIR"/container_pids_limit.json "$TESTDATA"/sandbox_config.json)' failed
> time="2020-11-18T05:02:01Z" level=fatal msg="running container: creating container failed: rpc error: code = Unknown desc = Error reading blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4: Get \"https://cdn02.quay.io/sharedimages/86f0a285-6f29-47c4-a3ae-7e2c70cad0ba/layer?Expires=1605676304&Signature=N976UlLi1Hb~jhKGQAy8JcmhlqFPdTzI3I3WiR7iEmb-x1YaIA6cWgWB3DffhwlaOrkzwHU8bAuWUEcwbD1N4tx3tAy7rhfQSyqWzbrs-OZJGON9aH7C5PkoqYPFDwGxQ1dzxtLSFR-hx1FmyN1lIuzFUKRmiQlPZPj14VGh51olcYgw2QVOPHE7~asGYa7EtQO~9q9A4Cgo7AAKzVsgDTjw19KReyIl5yh8am272W0AMrCoELwqC83F0FV3i6IZsomhnm30BHa4D5Xz1Jzr-dy4VWpM-Y8mowR4AVH9PLi6aALmYk1Ei54QjDEtkjSwc4sIVISb7g2uiKSDbLFHbQ__&Key-Pair-Id=APKAJ67PQLWGCSP66DGA\": net/http: TLS handshake timeout"

Also, while no-pull-on-create is the default, set it anyway
explicitly.

A test case that requires an image not listed in $IMAGES
should either do an explicit "crictl pull", or use --with-pull.

[1] kubernetes-sigs/cri-tools#627

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Nov 19, 2020
1 parent 0fcc2a5 commit ac250b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,20 @@ function setup_test() {
cp "$INTEGRATION_ROOT"/cni_plugin_helper.bash "$CRIO_CNI_PLUGIN"
sed -i "s;%TEST_DIR%;$TESTDIR;" "$CRIO_CNI_PLUGIN"/cni_plugin_helper.bash

# Configure crictl to not try pulling images on create/run,
# as $IMAGES are already preloaded, and eliminating network
# interaction results in less flakes when creating containers.
#
# A test case that requires an image not listed in $IMAGES
# should either do an explicit "crictl pull", or use --with-pull.
crictl config \
--set pull-image-on-create=false \
--set disable-pull-on-run=true \
2>/dev/null || true
# ^^^^^^^^^^^^^^^^^^^ TODO: remove the line above once crictl is updated
# to >= 1.19. Note tt's not an issue if this setting is not working, and
# some CI jobs (kata) use older crictl, so set this on a best-effort basis.

PATH=$PATH:$TESTDIR
}

Expand Down

0 comments on commit ac250b5

Please sign in to comment.