]> granicus.if.org Git - php/commitdiff
Skip ftruncate_bug76422 if disk_free_space() <= 4GB
authorTyson Andre <tysonandre775@hotmail.com>
Sat, 21 Mar 2020 14:58:35 +0000 (10:58 -0400)
committerTyson Andre <tysonandre775@hotmail.com>
Sat, 21 Mar 2020 16:01:28 +0000 (12:01 -0400)
Followup to https://github.com/php/php-src/pull/5043

In the middle of running this test with TESTS=-j9,
run-tests.php stopped the test suite because the partition started
with 3.5GB of free disk space and new test files couldn't be created.

Reclaiming the disk space of that file also took a while.

Closes GH-5283

ext/standard/tests/file/ftruncate_bug76422.phpt

index 84134acfd07694c66241f684bb874e272ad51d2e..978a8c7a71febb8d8be116b751e6445e72f9f2b6 100644 (file)
@@ -5,6 +5,10 @@ Bug #76422 ftruncate fails on files > 2GB
 if (PHP_INT_SIZE < 8) {
     die('skip.. only valid for 64-bit');
 }
+if (disk_free_space(__DIR__) <= 4.1 * 1024 * 1024 * 1024 ) {
+    // Add a bit of extra overhead for other processes, temporary files created while running tests, etc.
+    die('skip.. This test requires over 4GB of free disk space on this disk partition');
+}
 ?>
 --FILE--
 <?php