Skip to content

Commit b562541

Browse files
committed
Fixup testsuite
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
1 parent ce1550f commit b562541

18 files changed

Lines changed: 18 additions & 18 deletions

tests/ext/appsec/agentic_onboarding_test.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for ($i = 0; $i < 300; ++$i) {
1919
if (file_exists(__DIR__ . '/'.$id.'-telemetry.out')) {
2020
$batches = [];
2121
foreach (file(__DIR__ . '/'.$id.'-telemetry.out') as $l) {
22-
if ($l) {
22+
if ($l && $l[0] == '{') {
2323
$json = json_decode($l, true);
2424
if ($json) {
2525
if ($json["application"]["service_name"] == "background_sender-php-service" || $json["application"]["service_name"] == "datadog-ipc-helper") {

tests/ext/appsec/sca_test.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for ($i = 0; $i < 300; ++$i) {
1919
if (file_exists(__DIR__ . '/'.$id.'-telemetry.out')) {
2020
$batches = [];
2121
foreach (file(__DIR__ . '/'.$id.'-telemetry.out') as $l) {
22-
if ($l) {
22+
if ($l && $l[0] == '{') {
2323
$json = json_decode($l, true);
2424
if ($json) {
2525
if ($json["application"]["service_name"] == "background_sender-php-service" || $json["application"]["service_name"] == "datadog-ipc-helper") {

tests/ext/library_config/fleet_config.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ for ($i = 0; $i < 100; ++$i) {
4242
("us" . "leep")(100000);
4343
if (file_exists(__DIR__ . '/fleet-config-telemetry.out')) {
4444
foreach (file(__DIR__ . '/fleet-config-telemetry.out') as $l) {
45-
if ($l) {
45+
if ($l && $l[0] == '{') {
4646
$json = json_decode($l, true);
4747
$batch = $json["request_type"] == "message-batch" ? $json["payload"] : [$json];
4848
foreach ($batch as $json) {

tests/ext/library_config/local_config.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ for ($i = 0; $i < 100; ++$i) {
4242
("us" . "leep")(100000);
4343
if (file_exists(__DIR__ . '/local-config-telemetry.out')) {
4444
foreach (file(__DIR__ . '/local-config-telemetry.out') as $l) {
45-
if ($l) {
45+
if ($l && $l[0] == '{') {
4646
$json = json_decode($l, true);
4747
$batch = $json["request_type"] == "message-batch" ? $json["payload"] : [$json];
4848
foreach ($batch as $json) {

tests/ext/telemetry/broken_pipe.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ for ($i = 0; $i < 300; ++$i) {
3838
if (file_exists(__DIR__ . '/broken_pipe-telemetry.out')) {
3939
$batches = [];
4040
foreach (file(__DIR__ . '/broken_pipe-telemetry.out') as $l) {
41-
if ($l) {
41+
if ($l && $l[0] == '{') {
4242
$json = json_decode($l, true);
4343
if ($json["application"]["service_name"] == "background_sender-php-service" || $json["application"]["service_name"] == "datadog-ipc-helper") {
4444
continue;

tests/ext/telemetry/composer.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ for ($i = 0; $i < 300; ++$i) {
2727
("us" . "leep")(100000);
2828
if (file_exists(__DIR__ . '/composer-telemetry.out')) {
2929
foreach (file(__DIR__ . '/composer-telemetry.out') as $l) {
30-
if ($l) {
30+
if ($l && $l[0] == '{') {
3131
$json = json_decode($l, true);
3232
$batch = $json["request_type"] == "message-batch" ? $json["payload"] : [$json];
3333
foreach ($batch as $json) {

tests/ext/telemetry/config.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ for ($i = 0; $i < 300; ++$i) {
4242
("us" . "leep")(100000);
4343
if (file_exists(__DIR__ . '/config-telemetry.out')) {
4444
foreach (file(__DIR__ . '/config-telemetry.out') as $l) {
45-
if ($l) {
45+
if ($l && $l[0] == '{') {
4646
$json = json_decode($l, true);
4747
$batch = $json["request_type"] == "message-batch" ? $json["payload"] : [$json];
4848
foreach ($batch as $json) {

tests/ext/telemetry/disabled.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DDTrace\close_span();
1919
dd_trace_internal_fn("finalize_telemetry");
2020

2121
usleep(100000);
22-
var_dump(file_exists(__DIR__ . '/disabled-telemetry.out'));
22+
var_dump(strpos(@file_get_contents(__DIR__ . '/disabled-telemetry.out') ?: "", "app-started"));
2323

2424
?>
2525
--EXPECT--

tests/ext/telemetry/integration.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace
4848
("us" . "leep")(100000);
4949
if (file_exists(__DIR__ . '/integration-telemetry.out')) {
5050
foreach (file(__DIR__ . '/integration-telemetry.out') as $l) {
51-
if ($l) {
51+
if ($l && $l[0] == '{') {
5252
$json = json_decode($l, true);
5353
$batch = $json["request_type"] == "message-batch" ? $json["payload"] : [$json];
5454
foreach ($batch as $json) {

tests/ext/telemetry/integration_filesystem_01.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace
2525
usleep(100000);
2626
if (file_exists($file )) {
2727
foreach (file($file) as $l) {
28-
if ($l) {
28+
if ($l && $l[0] == '{') {
2929
$json = json_decode($l, true);
3030
$batch = $json["request_type"] == "message-batch" ? $json["payload"] : [$json];
3131
foreach ($batch as $json) {

0 commit comments

Comments
 (0)