Updated ImageGCTerminatedPodsEviction to ImageGCTerminatedPodsContainersCleanup to test that
terminated containers are being cleaned up, instead of testing if terminated pods were being evicted
Whenever swap is provisioned on the node,
the kernel might be able to reclaim much more memory,
hence it is harder to get the node to be memory pressured.
This will add another container that allocates
the same amount as the swap capacity to help
bring the node to memory pressure.
Signed-off-by: Itamar Holder <iholder@redhat.com>
This small refactor:
- Adds swap log statistics.
- Adds a pre pods modification function.
The later can be used in order to perform
changes to pods before creation.
Signed-off-by: Itamar Holder <iholder@redhat.com>
ImageGCNoEviction fails when tests run by kubetest2 as the test depends
on the prepulled test images (framework.TestContext.PrepullImages), but
kubetest2 --prepull-images command line option is set to false by
default.
Prepulling images explicitly for the only test that uses them
should fix the issue.
This changes the text registration so that tags for which the framework has a
dedicated API (features, feature gates, slow, serial, etc.) those APIs are
used.
Arbitrary, custom tags are still left in place for now.
With the new busybox, ash has a built-in sleep command. Prior to this
change we were creating half the pids expected since `sleep` wasn't
actually launching a new binary. Use the full path to /bin/sleep which
avoids the built-in and actually launches a new process.
All of these issues were reported by https://github.com/nunnatsa/ginkgolinter.
Fixing these issues is useful (several expressions get simpler, using
framework.ExpectNoError is better because it has additional support for
failures) and a necessary step for enabling that linter in our golangci-lint
invocation.
All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
Every ginkgo callback should return immediately when a timeout occurs or the
test run manually gets aborted with CTRL-C. To do that, they must take a ctx
parameter and pass it through to all code which might block.
This is a first automated step towards that: the additional parameter got added
with
sed -i 's/\(framework.ConformanceIt\|ginkgo.It\)\(.*\)func() {$/\1\2func(ctx context.Context) {/' \
$(git grep -l -e framework.ConformanceIt -e ginkgo.It )
$GOPATH/bin/goimports -w $(git status | grep modified: | sed -e 's/.* //')
log_test.go was left unchanged.