summaryrefslogtreecommitdiff
path: root/ext/pcntl/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add --repeat testing modeNikita Popov2020-10-304-0/+4
| | | | | | | | | 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.
* Update ext/pcntl parameter namesNikita Popov2020-10-063-4/+4
| | | | Closes GH-6278.
* Run tidyNikita Popov2020-09-1810-30/+30
| | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* Promote warnings to exceptions in ext/pcntlMáté Kocsis2020-08-256-15/+89
| | | | Closes GH-6004
* Check permissions in pcntl_unshare_03.phptNikita Popov2020-08-101-2/+5
|
* Add many missing closing PHP tags to testsMáté Kocsis2020-08-093-3/+6
| | | | Closes GH-5958
* Merge branch 'PHP-7.4'Nikita Popov2020-08-051-2/+5
|\ | | | | | | | | | | * PHP-7.4: Check ps -p availability in process title test Add privilege check in pcntl_unshare test
| * Add privilege check in pcntl_unshare testNikita Popov2020-08-051-2/+5
| | | | | | | | Privileges for CLONE_NEWPID were not checked.
* | Merge branch 'PHP-7.4'Nikita Popov2020-08-051-2/+2
|\ \ | |/ | | | | | | | | | | | | * PHP-7.4: Check ps -p availability in proc_nice test Set AI_CANONNAME flag in socket_addrinfo test Add ipv6 skipif to test Improve privilege check in pcntl_setpriority() test
| * Improve privilege check in pcntl_setpriority() testNikita Popov2020-08-051-2/+2
| | | | | | | | | | We need CAP_SYS_NICE privileges, which might not be available just because we're running as root (Docker...)
| * Suppress warning in pcntl_unshare skipifNikita Popov2020-08-051-1/+1
| |
* | Suppress warning in pcntl_unshare skipifNikita Popov2020-08-051-1/+1
| |
* | Replace EXPECTF when possibleFabien Villepinte2020-06-292-2/+2
| | | | | | | | Closes GH-5779
* | Honor script time limit when calling shutdown functionsAlex Dowad2020-05-131-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A time limit can be set on PHP script execution via `set_time_limit` (or .ini file). When the time limit is reached, the OS will notify PHP and `timed_out` and `vm_interrupt` flags are set. While these flags are regularly checked when executing PHP code, once the end of the script is reached, they are not checked while invoking shutdown functions (registered via `register_shutdown_function`). Of course, if the shutdown functions are implemented *in* PHP, then the interrupt flag will be checked while the VM is running PHP bytecode and the timeout will take effect. But if the shutdown functions are built-in (implemented in C), it will not. Since the shutdown functions are invoked through `zend_call_function`, add a check of the `vm_interrupt` flag there. Then, the script time limit will be respected when *entering* each shutdown function. The fact still remains that if a shutdown function is built-in and runs for a long time, script execution will not time out until it finishes and the interpreter tries to invoke the next one. Still, the behavior of scripts with execution time limits will be more consistent after this patch. To make the execution time-out feature work even more precisely, it would be necessary to scrutinize all the built-in functions and add checks of the `vm_interrupt` flag in any which can run for a long time. That might not be worth the effort, though. It should be mentioned that this patch does not solely affect shutdown functions, neither does it solely allow for interruption of running code due to script execution timeout. Anything else which causes `vm_interrupt` to be set, such as the PHP interpreter receiving a signal, will take effect when exiting from an internal function. And not just internal functions which are called because they were registered to run at shutdown; there are other cases where a series of internal functions might run in the midst of a script. In all such cases, it will be possible to interrupt the interpreter now. Closes GH-5543.
* | Reindent phpt filesNikita Popov2020-02-038-152/+152
| |
* | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-2/+2
| |
* | Merge branch 'PHP-7.4'Nikita Popov2019-12-201-1/+1
|\ \ | |/ | | | | | | * PHP-7.4: Fix #78402: pcntl_signal() misleading error message
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-12-201-1/+1
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #78402: pcntl_signal() misleading error message
| | * Fix #78402: pcntl_signal() misleading error messageSATO Kentaro2019-12-201-1/+1
| | | | | | | | | | | | | | | An error message can be misleading when a handler passed to pcntl_signal() is not callable.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-10-241-7/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | * PHP-7.4: Skip large ftruncate test if large files not supported Don't test "blocks" in lstat_stat_variation7.phpt Increase FD used in php://fd test Use posix_getuid() to check for root in pcntl_setpriority() test
| * | Use posix_getuid() to check for root in pcntl_setpriority() testNikita Popov2019-10-241-7/+7
| | | | | | | | | | | | | | | Using SUDO_USER doesn't seem to work on Travis ARM CI -- I guess that sudo might be in use without the target being root.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-07-031-0/+1
|\ \ \ | |/ /
| * | Skip pcntl_sigwaitinfo() test under asan/msanNikita Popov2019-07-031-0/+1
| | | | | | | | | | | | | | | This test often fails under asan/msan with a timeout for unknown reasons.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-06-281-0/+1
|\ \ \ | |/ /
| * | Set up asan+ubsan scheduled build on azureNikita Popov2019-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also adds an --asan flag to run-tests.php to setup all the necessary environment variables. Some tests are marked as skipped because they are incompatible with asan or too slow. I'm basing this on the DEBUG_ZTS build, which seems to give us the most mileage.
* | | Merge branch 'PHP-7.4'Joe Watkins2019-06-141-0/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: disable this test temporarily
| * | disable this test temporarilyJoe Watkins2019-06-141-0/+3
| | |
* | | Merge branch 'PHP-7.4'Joe Watkins2019-06-141-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: fix mac tests on azure
| * | fix mac tests on azureJoe Watkins2019-06-141-1/+1
| | |
* | | Adjust tests for zpp TypeError changeNikita Popov2019-03-114-44/+0
|/ /
* | Implement pcntl_unsharePedro Magalhães2019-02-183-0/+79
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-02-121-0/+20
|\ \ | |/
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-02-121-0/+20
| |\
| | * Make pid & uid available while handling realtime signalshsldymq2019-02-121-0/+20
| | |
| | * Trim trailing whitespace in *.phptPeter Kokot2018-10-1411-24/+24
| | |
| * | Trim trailing whitespace in *.phptPeter Kokot2018-10-1411-24/+24
| | |
* | | Add test case for pcntl_setpriority basic behaviourEr Galvão Abbott2019-02-101-0/+23
| | |
* | | Add test for pcntl_getpriority() basic behaviourEr Galvão Abbott2019-02-091-0/+19
| | |
* | | Trim trailing whitespace in *.phptPeter Kokot2018-10-141-2/+2
| | |
* | | Trim trailing whitespace in testsGabriel Caruso2018-10-1411-22/+22
|/ /
* | Use EXPECT instead of EXPECTF when possibleGabriel Caruso2018-02-206-6/+6
|/ | | | EXPECTF logic in run-tests.php is considerable, so let's avoid it.
* Merge branch 'PHP-7.1'Nikita Popov2016-12-291-0/+28
|\
| * Fixed bug #73783David Walker2016-12-291-0/+28
| | | | | | | | | | | | | | | | | | | | | | Bug #73783 raises an issue with signal handling when using SIG_IGN. With PHP7.1 ZEND_SIGNALS is defaulted to on, which will for all signals set the handler as zend_signal_handler_defer. This is problematic for syscalls like sleep(), which will only return when the requisite number of seconds have elapsed, or, a non-ignored signal is raised. In this case we want to SIG_IGN SIGCHLD, however, SIG_IGN is only stored in the SIGG(handlers) array, and the actual system level handler is defined. This prevents proper signal ignoring when requeted.
* | Remove the binary cast from unrelated testsPedro Magalhães2016-11-201-1/+1
| |
* | Remove the b prefix from literals on unrelated testsPedro Magalhães2016-11-201-3/+3
|/
* Merge RFC Additional Context in pcntl_signal HandlerDavey Shafik2016-07-201-0/+7
|\
| * pnctl_signal(): add siginfo to handler argsDavid Walker2016-07-071-0/+7
| | | | | | | | | | | | | | Feature will utilize already available siginfo parsing and extend the handler for signals to provide an array of the siginfo_t data. RFC:https://wiki.php.net/rfc/additional-context-in-pcntl-signal-handler
* | Fix pcntl_signal_get_handler() testAaron Piotrowski2016-07-111-6/+4
|/ | | | Test was failing on Fedora.
* oops, name test rightDavid Walker2016-07-061-1/+1
|
* Fix #72409 - return previous handlerDavid Walker2016-07-061-0/+32
| | | | | | | | | | | | This patch addresses https://bugs.php.net/bug.php?id=72409 This patch is applied to master compared to PR#1952 which was patching 5.6.x branch of PHP This patch takes into account discussions on PR #1978 Addressing that rather than have pcntl_signal() return a value to create a new function that can be used to get the current value of the signal handler.