From a9ff70447be0d01e57650c2b878a24e15428f72c Mon Sep 17 00:00:00 2001 From: NathanFreeman <1056159381@qq.com> Date: Sat, 8 Jun 2024 08:49:16 +0800 Subject: [PATCH] fix test --- tests/swoole_runtime/file_hook/bug_4327.phpt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/swoole_runtime/file_hook/bug_4327.phpt b/tests/swoole_runtime/file_hook/bug_4327.phpt index e23173c0587..d19e6efc9cd 100644 --- a/tests/swoole_runtime/file_hook/bug_4327.phpt +++ b/tests/swoole_runtime/file_hook/bug_4327.phpt @@ -17,11 +17,6 @@ Swoole\Runtime::enableCoroutine($flags = SWOOLE_HOOK_ALL); function createDirectories($protocol = "") { - if (defined('SWOOLE_THREAD')) { - echo "SUCCESS".PHP_EOL; - return; - } - $barrier = Barrier::make(); $first = "$protocol/".rand(0, 1000); $second = "/".rand(0, 1000); @@ -49,9 +44,14 @@ run(function () { createDirectories("file://"); }); -Swoole\Runtime::enableCoroutine(false); -createDirectories(); -createDirectories("file://"); +if (defined('SWOOLE_THREAD')) { + echo "SUCCESS".PHP_EOL; +} else { + Swoole\Runtime::enableCoroutine(false); + createDirectories(); + createDirectories("file://"); +} + ?> --EXPECT-- SUCCESS