Skip to content

Commit

Permalink
Fix conflicting pattern wrapping in FPM openmetrics test
Browse files Browse the repository at this point in the history
  • Loading branch information
bukka committed Oct 2, 2021
1 parent 390d4e9 commit 4ef6280
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sapi/fpm/tests/status.inc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class Status
*/
protected function checkStatusOpenmetrics(string $body, array $fields)
{
$pattern = "|# HELP phpfpm_up Could pool " . $fields['pool'] . " using a " . $fields['process manager'] . " PM on PHP-FPM be reached\?\n" .
$pattern = "(# HELP phpfpm_up Could pool " . $fields['pool'] . " using a " . $fields['process manager'] . " PM on PHP-FPM be reached\?\n" .
"# TYPE phpfpm_up gauge\n" .
"phpfpm_up 1\n" .
"# HELP phpfpm_start_since The number of seconds since FPM has started\.\n" .
Expand Down Expand Up @@ -241,7 +241,7 @@ class Status
"phpfpm_max_children_reached " . $fields['max children reached'] . "\n" .
"# HELP phpfpm_slow_requests The number of requests that exceeded your 'request_slowlog_timeout' value\.\n" .
"# TYPE phpfpm_slow_requests counter\n" .
"phpfpm_slow_requests " . $fields['slow requests'] . "|";
"phpfpm_slow_requests " . $fields['slow requests'] . ")";

if (!preg_match($pattern, $body)) {
echo "ERROR: Expected body does not match pattern\n";
Expand Down

0 comments on commit 4ef6280

Please sign in to comment.