k3s/test/e2e_node
Kubernetes Submit Queue 3bc1a0a1d0
Merge pull request #60900 from dashpole/eviction_test_no_pressure
Automatic merge from submit-queue (batch tested with PRs 60900, 62215, 62196). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[Flaky test fix] Use memory.force_empty before and after eviction tests

**What this PR does / why we need it**:
(copied from https://github.com/kubernetes/kubernetes/pull/60720):
MemoryAllocatableEviction tests have been somewhat flaky: https://k8s-testgrid.appspot.com/sig-node-kubelet#kubelet-serial-gce-e2e&include-filter-by-regex=MemoryAllocatable
The failure on the flakes is ["Pod ran to completion"](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-node-kubelet-serial/3785#k8sio-memoryallocatableeviction-slow-serial-disruptive-when-we-run-containers-that-should-cause-memorypressure-should-eventually-evict-all-of-the-correct-pods).
Looking at [an example log](https://storage.googleapis.com/kubernetes-jenkins/logs/ci-kubernetes-node-kubelet-serial/3785/artifacts/tmp-node-e2e-6070a774-cos-stable-63-10032-71-0/kubelet.log) (and search for memory-hog-pod, we can see that this pod fails admission because the allocatable memory threshold has already been crossed.
`eviction manager: thresholds - ignoring grace period: threshold [signal=allocatableMemory.available, quantity=250Mi] observed 242404Ki`

https://github.com/kubernetes/kubernetes/pull/60720 wasn't effective.  To clean-up after each eviction test, and prepare for the next, use memory.force_empty to make the kernel reclaim memory in the allocatable cgroup before and after eviction tests.

**Special notes for your reviewer**:
I tested to make sure this doesn't break Cgroup Manager tests.
It should work on both cgroupfs and systemd based systems, although I have only tested in on cgroupfs.

**Release note**:
```release-note
NONE
```

/assign @yujuhong @Random-Liu 
/sig node
/priority important-soon
/kind bug

its getting a little late in the release cycle, so we can probably wait until after code freeze is lifted for this.
2018-04-06 21:30:06 -07:00
..
builder use node-e2e framework for testing cadvisor 2018-01-31 10:14:54 -08:00
conformance remove gcloud docker -- since it's deprecated 2018-02-28 00:24:27 -08:00
environment Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
jenkins fix all the typos across the project 2018-02-11 11:04:14 +08:00
perftype
remote Merge pull request #61740 from filbranden/nodetest1 2018-03-29 21:10:03 -07:00
runner Fix go vet errors 2018-04-02 17:57:44 -07:00
services make kube-apiserver ServerRunOptions setdefault and Validate before use 2018-04-04 11:19:55 +08:00
system Replace "golang.org/x/net/context" with "context" 2018-03-22 20:57:14 +08:00
BUILD use memory.force_empty before and after eviction tests 2018-04-06 14:01:11 -07:00
OWNERS Add balajismaniam, ConnorDoyle node-e2e approvers 2017-11-22 10:01:14 -08:00
README.md
apparmor_test.go fix all the typos across the project 2018-02-11 11:04:14 +08:00
benchmark_util.go
container.go remove a todo which is out of date 2018-02-07 09:31:15 +08:00
container_log_rotation_test.go Add node e2e test for log rotation. 2018-02-23 01:42:35 +00:00
container_manager_test.go Removed newlines from e2e log statements. 2018-02-17 22:25:38 -05:00
cpu_manager_test.go Remove unused variables (only assigned to) from test code. 2018-02-27 13:45:31 -08:00
critical_pod_test.go Use pause manifest image 2018-04-06 11:00:50 +05:30
density_test.go Use pause manifest image 2018-04-06 11:00:50 +05:30
device_plugin.go I forgot the fact that the DevicePlugin test itself restarts Kubelet 2018-03-01 14:02:09 -08:00
doc.go
docker_test.go Add node-e2e test for ShareProcessNamespace 2018-02-28 09:15:56 +01:00
docker_util.go Skip log path tests when they are expected to fail. 2018-01-19 10:51:13 -08:00
dockershim_checkpoint_test.go Use pause manifest image 2018-04-06 11:00:50 +05:30
dynamic_kubelet_config_test.go node authorizer sets up access rules for dynamic config 2018-03-27 08:49:45 -07:00
e2e_node_suite_test.go Add a few "+build linux" tags where appropriate. 2018-02-27 13:53:32 -08:00
eviction_test.go use memory.force_empty before and after eviction tests 2018-04-06 14:01:11 -07:00
framework.go Add [sig-node] to some unowned e2e_node tests 2017-11-27 11:35:44 -05:00
garbage_collector_test.go fix all the typos across the project 2018-02-11 11:04:14 +08:00
gke_environment_test.go Switch to k8s.gcr.io vanity domain 2018-02-07 21:14:19 -08:00
gpu_device_plugin.go Delete in-tree support for NVIDIA GPUs. 2018-04-02 20:17:01 -07:00
gubernator.sh cluster: move logging library to hack/ 2018-01-13 16:37:50 -08:00
hugepages_test.go Add node e2e to verify hugepages feature 2018-02-08 10:37:04 -05:00
image_id_test.go Switch to k8s.gcr.io vanity domain 2018-02-07 21:14:19 -08:00
image_list.go Use pause manifest image 2018-04-06 11:00:50 +05:30
kubelet_test.go
lifecycle_hook_test.go Use pause manifest image 2018-04-06 11:00:50 +05:30
log_path_test.go Skip log path tests when they are expected to fail. 2018-01-19 10:51:13 -08:00
mirror_pod_test.go Use pause manifest image 2018-04-06 11:00:50 +05:30
node_container_manager_test.go Merge pull request #55898 from dashpole/fix_flaky_allocatable 2017-11-18 13:13:24 -08:00
node_problem_detector_linux.go fix all the typos across the project 2018-02-11 11:04:14 +08:00
pods_container_manager_test.go use memory.force_empty before and after eviction tests 2018-04-06 14:01:11 -07:00
resource_collector.go more concise to merge the array 2018-02-11 21:27:11 +08:00
resource_usage_test.go Use pause manifest image 2018-04-06 11:00:50 +05:30
restart_test.go Use pause manifest image 2018-04-06 11:00:50 +05:30
runtime_conformance_test.go Switch to k8s.gcr.io vanity domain 2018-02-07 21:14:19 -08:00
security_context_test.go Add node-e2e test for ShareProcessNamespace 2018-02-28 09:15:56 +01:00
simple_mount.go Use pause manifest image 2018-04-06 11:00:50 +05:30
summary_test.go In summary_test, make Docker cpu/memory checks optional if unavailable. 2018-03-29 18:12:30 -07:00
util.go Merge pull request #60900 from dashpole/eviction_test_no_pressure 2018-04-06 21:30:06 -07:00
volume_manager_test.go

README.md