Skip to content

Commit 3f1e923

Browse files
committed
Fix test with POSIX_RLIMIT_FSIZE and gcov
1 parent ac54bfb commit 3f1e923

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/opcache/tests/file_cache_error.phpt

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ opcache.log_verbosity_level=2
1111
opcache.interned_strings_buffer=8
1212
--SKIPIF--
1313
<?php
14-
if (!posix_setrlimit(POSIX_RLIMIT_FSIZE, 1, 1)) die('skip Test requires setrlimit(RLIMIT_FSIZE) to work');
14+
if (!posix_setrlimit(POSIX_RLIMIT_FSIZE, 1, -1)) die('skip Test requires setrlimit(RLIMIT_FSIZE) to work');
1515
if (ini_parse_quantity(ini_get('opcache.jit_buffer_size')) !== 0) die('skip File cache is disabled when JIT is on');
16+
// Allow gcov to write to file
17+
posix_setrlimit(POSIX_RLIMIT_FSIZE, -1, -1);
1618
?>
1719
--FILE--
1820
<?php
@@ -31,10 +33,13 @@ if (defined('SIGXFSZ')) {
3133
}
3234

3335
// Should cause writing to cache file to fail
34-
var_dump(posix_setrlimit(POSIX_RLIMIT_FSIZE, 1, 1));
36+
var_dump(posix_setrlimit(POSIX_RLIMIT_FSIZE, 1, -1));
3537

3638
// Will attempt to write to cache file, and fail
3739
require $file;
40+
41+
// Allow gcov to write to file
42+
posix_setrlimit(POSIX_RLIMIT_FSIZE, -1, -1);
3843
?>
3944
--EXPECTF--
4045
bool(true)

0 commit comments

Comments
 (0)