Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/ext/crashtracker_collect_all_threads.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,14 @@ $rr->waitForRequest(function ($request) {
}

$error = $payload["message"]["error"] ?? null;
$threads = $error["threads"]["threads"] ?? null;
$count = $threads !== null ? count($threads) : 0;
// libdatadog serializes error.threads as a flat list of thread objects
// (each with name/stack/state). Older revisions nested it under a
// "threads" wrapper object (error.threads.threads); accept both shapes.
$threads = $error["threads"] ?? null;
if (is_array($threads) && isset($threads["threads"])) {
$threads = $threads["threads"];
}
$count = is_array($threads) ? count($threads) : 0;

echo "collect_all_threads enabled: ", ($count > 0 ? "yes" : "no"), PHP_EOL;
echo "thread count: ", $count, PHP_EOL;
Expand Down
Loading