summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-04-13 11:55:59 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-13 17:51:27 +0000
commitb8394600d855a88b38f01feeadf5a63e703183cd (patch)
tree02cfef45caed35d2a375e1f0f057da910ecc374c
parent4b25039cf4d9f38bbe7e8ed4a2fb3d87cf87e53e (diff)
downloadpodman-b8394600d855a88b38f01feeadf5a63e703183cd.tar.gz
podman-b8394600d855a88b38f01feeadf5a63e703183cd.tar.bz2
podman-b8394600d855a88b38f01feeadf5a63e703183cd.zip
HACK temporary fix for test suite
We leak open files when creating new c/storage stores (locks do not close themselves, so the open FDs in the test suite increase every time we use c/storage to load cached images for the tests). Fix this temporarily by increasing rlimits on open files until we can create a permanent fix next release. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #615 Approved by: baude
-rw-r--r--test/e2e/libpod_suite_test.go22
1 files changed, 19 insertions, 3 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go
index b5637b8c7..8e3b4254a 100644
--- a/test/e2e/libpod_suite_test.go
+++ b/test/e2e/libpod_suite_test.go
@@ -7,6 +7,7 @@ import (
"os/exec"
"path/filepath"
"strings"
+ "syscall"
"testing"
"time"
@@ -78,6 +79,19 @@ func TestLibpod(t *testing.T) {
CACHE_IMAGES = []string{}
RESTORE_IMAGES = []string{}
}
+
+ // HACK HACK HACK
+ // We leak file descriptors through c/storage locks and image caching
+ // Until we come up with a better solution, just set rlimits on open
+ // files really high
+ rlimits := new(syscall.Rlimit)
+ rlimits.Cur = 99999
+ rlimits.Max = 99999
+ if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil {
+ fmt.Printf("Error setting new rlimits: %v", err)
+ os.Exit(1)
+ }
+
RegisterFailHandler(Fail)
RunSpecs(t, "Libpod Suite")
}
@@ -326,9 +340,6 @@ func (p *PodmanTest) RestoreArtifact(image string) error {
storeOptions.GraphRoot = p.CrioRoot
storeOptions.RunRoot = p.RunRoot
store, err := sstorage.GetStore(storeOptions)
- defer store.Shutdown(false)
-
- options := &copy.Options{}
if err != nil {
return errors.Errorf("error opening storage: %v", err)
}
@@ -337,6 +348,7 @@ func (p *PodmanTest) RestoreArtifact(image string) error {
}()
storage.Transport.SetStore(store)
+
ref, err := storage.Transport.ParseStoreReference(store, image)
if err != nil {
return errors.Errorf("error parsing image name: %v", err)
@@ -348,6 +360,7 @@ func (p *PodmanTest) RestoreArtifact(image string) error {
if err != nil {
return errors.Errorf("error parsing image name %v: %v", image, err)
}
+
systemContext := types.SystemContext{
SignaturePolicyPath: p.SignaturePolicyPath,
}
@@ -355,6 +368,7 @@ func (p *PodmanTest) RestoreArtifact(image string) error {
if err != nil {
return errors.Errorf("error loading signature policy: %v", err)
}
+
policyContext, err := signature.NewPolicyContext(policy)
if err != nil {
return errors.Errorf("error loading signature policy: %v", err)
@@ -362,6 +376,8 @@ func (p *PodmanTest) RestoreArtifact(image string) error {
defer func() {
_ = policyContext.Destroy()
}()
+
+ options := &copy.Options{}
err = copy.Image(policyContext, ref, importRef, options)
if err != nil {
return errors.Errorf("error importing %s: %v", importFrom, err)