Merge pull request #102169 from odinuge/rlimit-tests

Ensure node-e2e-test can open enough files
This commit is contained in:
Kubernetes Prow Robot 2021-07-15 10:20:45 -07:00 committed by GitHub
commit 4f9bfb39ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,7 @@ import (
utilyaml "k8s.io/apimachinery/pkg/util/yaml"
clientset "k8s.io/client-go/kubernetes"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/kubernetes/pkg/util/rlimit"
commontest "k8s.io/kubernetes/test/e2e/common"
"k8s.io/kubernetes/test/e2e/framework"
e2econfig "k8s.io/kubernetes/test/e2e/framework/config"
@ -121,6 +122,12 @@ func TestMain(m *testing.M) {
const rootfs = "/rootfs"
func TestE2eNode(t *testing.T) {
// Make sure we are not limited by sshd when it comes to open files
if err := rlimit.SetNumFiles(1000000); err != nil {
klog.Infof("failed to set rlimit on max file handles: %v", err)
}
if *runServicesMode {
// If run-services-mode is specified, only run services in current process.
services.RunE2EServices(t)