diff options
author | Jonas Ã…dahl <jadahl@gmail.com> | 2020-11-13 09:08:43 +0100 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2020-12-03 21:39:13 +0000 |
commit | c55a3d1edc40b9ce860fe759a272043d36648162 (patch) | |
tree | 00464844a4e9260ee2dab61ac2b9e911a7337a7c /src/tests/anonymous-file.c | |
parent | c4dbf81c95e6b6c24ac0ff1d5d3b5d81999ed548 (diff) | |
download | mutter-c55a3d1edc40b9ce860fe759a272043d36648162.tar.gz |
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>
Diffstat (limited to 'src/tests/anonymous-file.c')
-rw-r--r-- | src/tests/anonymous-file.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/tests/anonymous-file.c b/src/tests/anonymous-file.c index ad8b5284b..29f5ceac8 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); |