summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/rootless/rootless_linux.c18
-rw-r--r--test/e2e/system_service_test.go14
2 files changed, 18 insertions, 14 deletions
diff --git a/pkg/rootless/rootless_linux.c b/pkg/rootless/rootless_linux.c
index e71d5d999..92f331ce4 100644
--- a/pkg/rootless/rootless_linux.c
+++ b/pkg/rootless/rootless_linux.c
@@ -19,6 +19,15 @@
#include <sys/select.h>
#include <stdio.h>
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif
+
#define cleanup_free __attribute__ ((cleanup (cleanup_freep)))
#define cleanup_close __attribute__ ((cleanup (cleanup_closep)))
#define cleanup_dir __attribute__ ((cleanup (cleanup_dirp)))
@@ -72,15 +81,6 @@ int rename_noreplace (int olddirfd, const char *oldpath, int newdirfd, const cha
return rename (oldpath, newpath);
}
-#ifndef TEMP_FAILURE_RETRY
-#define TEMP_FAILURE_RETRY(expression) \
- (__extension__ \
- ({ long int __result; \
- do __result = (long int) (expression); \
- while (__result == -1L && errno == EINTR); \
- __result; }))
-#endif
-
static const char *_max_user_namespaces = "/proc/sys/user/max_user_namespaces";
static const char *_unprivileged_user_namespaces = "/proc/sys/kernel/unprivileged_userns_clone";
diff --git a/test/e2e/system_service_test.go b/test/e2e/system_service_test.go
index 922a8c423..4299146f5 100644
--- a/test/e2e/system_service_test.go
+++ b/test/e2e/system_service_test.go
@@ -18,6 +18,10 @@ import (
var _ = Describe("podman system service", func() {
var podmanTest *PodmanTestIntegration
+ // The timeout used to for the service to respond. As shown in #12167,
+ // this may take some time on machines under high load.
+ var timeout = 5
+
BeforeEach(func() {
tempdir, err := CreateTempDirInTempDir()
Expect(err).ShouldNot(HaveOccurred())
@@ -45,7 +49,7 @@ var _ = Describe("podman system service", func() {
defer session.Kill()
WaitForService(address)
- Eventually(session, 5).Should(Exit(0))
+ Eventually(session, timeout).Should(Exit(0))
})
})
@@ -88,8 +92,8 @@ var _ = Describe("podman system service", func() {
Expect(err).ShouldNot(HaveOccurred())
Expect(body).ShouldNot(BeEmpty())
- session.Interrupt().Wait(2 * time.Second)
- Eventually(session, 5).Should(Exit(1))
+ session.Interrupt().Wait(time.Duration(timeout) * time.Second)
+ Eventually(session, timeout).Should(Exit(1))
})
It("are not available", func() {
@@ -110,8 +114,8 @@ var _ = Describe("podman system service", func() {
// Combined with test above we have positive/negative test for pprof
Expect(session.Err.Contents()).ShouldNot(ContainSubstring(magicComment))
- session.Interrupt().Wait(2 * time.Second)
- Eventually(session, 5).Should(Exit(1))
+ session.Interrupt().Wait(time.Duration(timeout) * time.Second)
+ Eventually(session, timeout).Should(Exit(1))
})
})
})