Files
frankenphp/testdata/failing-worker.php
Alexander Stecher 8bbd16d585 Removes worker panic when the watcher is enabled. (#1092)
* Removes the worker panic when the watcher is enabled.

* Only panics on the initial boot.

* Only panics on the initial boot.

* Resets to always panic when watcher is disabled.

---------

Co-authored-by: a.stecher <a.stecher@sportradar.com>
2024-10-14 20:58:26 +02:00

19 lines
298 B
PHP

<?php
$fail = random_int(1, 100) < 10;
$wait = random_int(1000 * 100, 1000 * 500); // wait 100ms - 500ms
usleep($wait);
if ($fail) {
exit(1);
}
while (frankenphp_handle_request(function () {
echo "ok";
})) {
$fail = random_int(1, 100) < 10;
if ($fail) {
exit(1);
}
}