Skip to content

Commit 85f2e0e

Browse files
committed
sapi/cli: enabled the test fork server in ZTS builds
1 parent 0a3bc16 commit 85f2e0e

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

run-tests.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,6 @@ function can_use_test_fork_server(): bool
15221522
global $cli_opcache_enabled, $environment, $file_cache, $IN_REDIRECT, $num_repeats, $preload, $valgrind;
15231523

15241524
return !IS_WINDOWS
1525-
&& !PHP_ZTS
15261525
&& !$cli_opcache_enabled
15271526
&& getenv('TEST_PHP_FORK_SERVER') !== '0'
15281527
&& !isset($environment['SKIP_ASAN'])

sapi/cli/php_cli.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ typedef enum {
181181
PHP_CLI_TEST_BATCH_DONE,
182182
} php_cli_test_batch_result;
183183

184-
#if defined(HAVE_FORK) && !defined(ZTS)
184+
#ifdef HAVE_FORK
185185
static volatile sig_atomic_t php_cli_test_child_pid;
186186

187187
static void php_cli_test_batch_signal(int signal) /* {{{ */
@@ -214,7 +214,7 @@ static bool php_cli_test_batch_init(php_cli_test_batch *batch, const char *token
214214
}
215215
/* }}} */
216216

217-
#if defined(HAVE_FORK) && !defined(ZTS)
217+
#ifdef HAVE_FORK
218218
static int php_cli_test_batch_read_line(char *buffer, size_t size) /* {{{ */
219219
{
220220
while (fgets(buffer, size, stdin)) {
@@ -365,8 +365,8 @@ static php_cli_test_batch_result php_cli_test_batch_start(
365365
char **script_file
366366
) /* {{{ */
367367
{
368-
#if !defined(HAVE_FORK) || defined(ZTS)
369-
fprintf(stderr, "--test-fork-server requires a non-ZTS build with fork()\n");
368+
#ifndef HAVE_FORK
369+
fprintf(stderr, "--test-fork-server requires fork()\n");
370370
return PHP_CLI_TEST_BATCH_ERROR;
371371
#else
372372
int test_output[2];
@@ -1199,7 +1199,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
11991199
param_error = "Unable to initialize test batch.\n";
12001200
}
12011201
}
1202-
#if defined(HAVE_FORK) && !defined(ZTS)
1202+
#ifdef HAVE_FORK
12031203
if (test_batch.token) {
12041204
signal(SIGINT, php_cli_test_batch_signal);
12051205
signal(SIGTERM, php_cli_test_batch_signal);

sapi/cli/tests/test_fork_server.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
CLI test fork server isolates requests and continues after a nonzero exit
33
--SKIPIF--
44
<?php
5-
if (PHP_OS_FAMILY === 'Windows' || PHP_ZTS) {
6-
die('skip requires a non-ZTS build with fork');
5+
if (PHP_OS_FAMILY === 'Windows') {
6+
die('skip requires fork');
77
}
88

99
$process = proc_open(

tests/run-test/fork_server_lifecycle.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Test fork server timeout, termination, and failure fallback
44
posix
55
--SKIPIF--
66
<?php
7-
if (PHP_OS_FAMILY === 'Windows' || PHP_ZTS) {
8-
die('skip requires a non-ZTS build with fork');
7+
if (PHP_OS_FAMILY === 'Windows') {
8+
die('skip requires fork');
99
}
1010

1111
$process = proc_open(

tests/run-test/fork_server_opcache.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Test fork server is disabled when CLI OPcache is enabled
44
opcache
55
--SKIPIF--
66
<?php
7-
if (PHP_OS_FAMILY === 'Windows' || PHP_ZTS) {
8-
die('skip requires a non-ZTS build with fork');
7+
if (PHP_OS_FAMILY === 'Windows') {
8+
die('skip requires fork');
99
}
1010

1111
$process = proc_open(

0 commit comments

Comments
 (0)