From a742010a0a3a89afa169b95e3ae8d107deb6508d Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 16 Nov 2023 14:13:38 +0100 Subject: [PATCH] Fix file test race condition 005_variation2.phpt creates files with special names, and filesize_variation5.phpt checks for filesize of inexistent files with special names. Create the files in a separate directory to avoid these tests clashing. Closes GH-12692 --- ext/standard/tests/file/005_variation2.phpt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/standard/tests/file/005_variation2.phpt b/ext/standard/tests/file/005_variation2.phpt index 55d1d666609..270a6cfbdd8 100644 --- a/ext/standard/tests/file/005_variation2.phpt +++ b/ext/standard/tests/file/005_variation2.phpt @@ -28,6 +28,11 @@ function stat_fn( $filename ) { echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n"; echo "\n*** testing touch ***\n"; + +$dir = __DIR__ . '/005_variation2'; +mkdir($dir); +chdir($dir); + $b = touch(false); $c = touch(''); $d = touch(' '); @@ -47,6 +52,7 @@ stat_fn('|'); var_dump(unlink(' ')); var_dump(unlink('|')); +rmdir($dir); echo "Done"; ?>