From 948ee4e56479c536082097b6e2ab99e2c9a09b20 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Wed, 3 Jun 2026 16:46:00 +0200 Subject: [PATCH] fix(ci): read flattened error.threads list in crashtracker test [test_extension_ci crashtracker] libdatadog bump #3927 (2026-06-02) flattened the crash report schema: error.threads changed from a wrapper object { threads: [...] } to a flat list of ThreadData. The test still read error.threads.threads, which is now null, so the collected threads (count > 0) were reported as 0. Read error.threads directly as the flat list while still accepting the legacy nested shape for backward compatibility. --- tests/ext/crashtracker_collect_all_threads.phpt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/ext/crashtracker_collect_all_threads.phpt b/tests/ext/crashtracker_collect_all_threads.phpt index 8d50561594e..2a5e07880ba 100644 --- a/tests/ext/crashtracker_collect_all_threads.phpt +++ b/tests/ext/crashtracker_collect_all_threads.phpt @@ -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;