[mutter] tests/anonymous-file: Skip the rlimit part of the test when running CI



commit c55a3d1edc40b9ce860fe759a272043d36648162
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Nov 13 09:08:43 2020 +0100

    tests/anonymous-file: Skip the rlimit part of the test when running CI
    
    SIGXFSZ is triggered for this test when running in a CI runner, but not
    on real hw. Skip running that part for now.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1557>

 src/tests/anonymous-file.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/src/tests/anonymous-file.c b/src/tests/anonymous-file.c
index ad8b5284b9..29f5ceac83 100644
--- a/src/tests/anonymous-file.c
+++ b/src/tests/anonymous-file.c
@@ -209,17 +209,25 @@ main (int    argc,
    * size this process may create to 2 bytes, if memfd_create with
    * MAPMODE_PRIVATE is used, everything should still work (the existing FD
    * should be used). */
-  struct rlimit limit = {2, 2};
-  if (setrlimit (RLIMIT_FSIZE, &limit) == -1)
-    goto fail;
 
-  fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
-  g_assert (fd != -1);
+  if (!getenv ("CI_JOB_ID"))
+    {
+      struct rlimit rlimit = {
+        .rlim_cur = 2,
+        .rlim_max = 2,
+      };
 
-  if (!test_read_fd_mmap (fd, teststring))
-    goto fail;
+      if (setrlimit (RLIMIT_FSIZE, &rlimit) == -1)
+        goto fail;
 
-  meta_anonymous_file_close_fd (fd);
+      fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
+      g_assert (fd != -1);
+
+      if (!test_read_fd_mmap (fd, teststring))
+        goto fail;
+
+      meta_anonymous_file_close_fd (fd);
+    }
 #else
   fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
   g_assert (fd != -1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]