Skip to content

Commit 1b3b430

Browse files
committed
Add --repeat testing mode
This testing mode executes the test multiple times in the same process (but in different requests). It is primarily intended to catch tracing JIT bugs, but also catches state leaks across requests. Closes GH-6365.
1 parent ada2a55 commit 1b3b430

18 files changed

+144
-29
lines changed

azure-pipelines.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,8 @@ jobs:
103103
configurationName: DEBUG_NTS_FILE_CACHE
104104
configurationParameters: '--enable-debug --disable-zts'
105105
timeoutInMinutes: 90
106+
- template: azure/job.yml
107+
parameters:
108+
configurationName: DEBUG_NTS_REPEAT
109+
configurationParameters: '--enable-debug --disable-zts'
110+
runTestsParameters: '--repeat 2'

ext/opcache/tests/bug65915.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ opcache.enable=1
55
opcache.enable_cli=1
66
opcache.file_cache_only=0
77
--SKIPIF--
8-
<?php require_once('skipif.inc'); ?>
8+
<?php
9+
require_once('skipif.inc');
10+
// We don't invalidate the file after the second write.
11+
if (getenv('SKIP_REPEAT')) die("skip Not repeatable");
12+
?>
913
--FILE--
1014
<?php
1115
$tmp = __DIR__ . "/bug65915.inc.php";

ext/opcache/tests/zzz_basic_logging.phpt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ opcache.log_verbosity_level=4
1212
opcache.huge_code_pages=0
1313
opcache.preload=
1414
--SKIPIF--
15-
<?php require_once('skipif.inc'); ?>
15+
<?php
16+
require_once('skipif.inc');
17+
// Prints "Debug Restarting!" message on next request.
18+
if (getenv('SKIP_REPEAT')) die("skip Not repeatable");
19+
?>
1620
--FILE--
1721
<?php
1822
echo "Foo Bar\n";

ext/pcntl/tests/002.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pcntl: pcntl_sigprocmask(), pcntl_sigwaitinfo(), pcntl_sigtimedwait()
77
elseif (!function_exists('pcntl_sigwaitinfo') or !function_exists('pcntl_sigtimedwait')) die('skip required functionality is not available');
88
elseif (!defined('CLD_EXITED')) die('skip CLD_EXITED not defined');
99
elseif (getenv('SKIP_ASAN')) die('skip Fails intermittently under asan/msan');
10+
elseif (getenv("SKIP_REPEAT")) die("skip cannot be repeated");
1011
?>
1112
--FILE--
1213
<?php

ext/pcntl/tests/pcntl_unshare_01.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (!defined("CLONE_NEWUSER")) die("skip flag unavailable");
99
if (@pcntl_unshare(CLONE_NEWUSER) == false && pcntl_get_last_error() == PCNTL_EPERM) {
1010
die("skip Insufficient privileges to use CLONE_NEWUSER");
1111
}
12+
if (getenv("SKIP_REPEAT")) die("skip cannot be repeated");
1213
?>
1314
--FILE--
1415
<?php

ext/pcntl/tests/pcntl_unshare_02.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if (posix_getuid() !== 0 &&
1515
if (@pcntl_unshare(CLONE_NEWPID) == false && pcntl_get_last_error() == PCNTL_EPERM) {
1616
die("skip Insufficient privileges for CLONE_NEWPID");
1717
}
18+
if (getenv("SKIP_REPEAT")) die("skip cannot be repeated");
1819
?>
1920
--FILE--
2021
<?php

ext/pcntl/tests/pcntl_unshare_03.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if (@pcntl_unshare(CLONE_NEWNET) == false && pcntl_get_last_error() == PCNTL_EPE
1515
die("skip Insufficient privileges for CLONE_NEWPID");
1616
}
1717
if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
18+
if (getenv("SKIP_REPEAT")) die("skip cannot be repeated");
1819
?>
1920
--FILE--
2021
<?php

ext/pgsql/tests/skipif.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ include("lcmess.inc");
1212
if (!extension_loaded("pgsql")) {
1313
die("skip pgsql extension not loaded\n");
1414
}
15+
if (getenv("SKIP_REPEAT")) {
16+
// pgsql tests are order-dependent.
17+
// We should probably change that, but in the meantime do not allow repetition.
18+
die("skip Cannot repeat pgsql tests");
19+
}
1520
$conn = @pg_connect($conn_str);
1621
if (!is_resource($conn)) {
1722
die("skip could not connect\n");

ext/readline/tests/libedit_info_001.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (READLINE_LIB != "libedit") die("skip libedit only");
66
if(substr(PHP_OS, 0, 3) == 'WIN' ) {
77
die('skip not for windows');
88
}
9+
if (getenv('SKIP_REPEAT')) die("skip readline has global state");
910
?>
1011
--FILE--
1112
<?php

ext/readline/tests/libedit_write_history_001.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (READLINE_LIB != "libedit") die("skip libedit only");
66
if(substr(PHP_OS, 0, 3) == 'WIN' ) {
77
die('skip not for windows');
88
}
9+
if (getenv('SKIP_REPEAT')) die("skip readline has global state");
910
?>
1011
--FILE--
1112
<?php

0 commit comments

Comments
 (0)