Skip to content

Commit 0111335

Browse files
committed
test(stress): skip ffe_send_exposure on PHP < 8.1
internal-api-stress-test.php only uses ReflectionFunction::getNumberOfRequiredParameters() on PHP 8.1+; on older versions the fuzzer starts enumerating from zero args. For the 5-required-arg ffe_send_exposure that explodes to ~15^5 permutations and exhausts PHP's 128MB memory limit before ArgumentCountError pruning runs. Skip the function on PHP < 8.1 so the randomized stress test stays green on 7.x and 8.0.
1 parent bf5d4d2 commit 0111335

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/internal-api-stress-test.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,13 @@ function runOneIteration()
200200
&& !strpos($f->name, "Testing")
201201
&& $f->name != "dd_trace_disable_in_request"
202202
&& (PHP_VERSION_ID >= 70100 || $f->name != 'DDTrace\curl_multi_exec_get_request_spans')
203-
&& $f->name != "DDTrace\Internal\handle_fork";
203+
&& $f->name != "DDTrace\Internal\handle_fork"
204+
// PHP < 8.1 ReflectionFunction::getNumberOfRequiredParameters() is unused here, so
205+
// the fuzzer enumerates param permutations from $i=0. For functions with many
206+
// required args this is exponential and blows PHP's memory limit before the
207+
// ArgumentCountError-based pruning kicks in. Skip the 5-required-arg FFE exposure
208+
// sender on old PHP.
209+
&& (PHP_VERSION_ID >= 80100 || $f->name != 'DDTrace\ffe_send_exposure');
204210
});
205211

206212
$props = array_filter(

0 commit comments

Comments
 (0)