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>
This commit is contained in:
Jonas Ådahl 2020-11-13 09:08:43 +01:00 committed by Marge Bot
parent c4dbf81c95
commit c55a3d1edc

View File

@ -209,8 +209,15 @@ main (int argc,
* size this process may create to 2 bytes, if memfd_create with * size this process may create to 2 bytes, if memfd_create with
* MAPMODE_PRIVATE is used, everything should still work (the existing FD * MAPMODE_PRIVATE is used, everything should still work (the existing FD
* should be used). */ * should be used). */
struct rlimit limit = {2, 2};
if (setrlimit (RLIMIT_FSIZE, &limit) == -1) if (!getenv ("CI_JOB_ID"))
{
struct rlimit rlimit = {
.rlim_cur = 2,
.rlim_max = 2,
};
if (setrlimit (RLIMIT_FSIZE, &rlimit) == -1)
goto fail; goto fail;
fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE); fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
@ -220,6 +227,7 @@ main (int argc,
goto fail; goto fail;
meta_anonymous_file_close_fd (fd); meta_anonymous_file_close_fd (fd);
}
#else #else
fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE); fd = meta_anonymous_file_open_fd (file, META_ANONYMOUS_FILE_MAPMODE_PRIVATE);
g_assert (fd != -1); g_assert (fd != -1);