fix(test-optimization): omit empty FTR capture containers#9304
Conversation
Overall package sizeSelf size: 6.71 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 438.86 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: d94153a | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-13 11:30:27 Comparing candidate commit d94153a in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2309 metrics, 49 unstable metrics.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9304 +/- ##
==========================================
+ Coverage 96.57% 96.58% +0.01%
==========================================
Files 918 918
Lines 121577 121584 +7
Branches 21074 20994 -80
==========================================
+ Hits 117407 117433 +26
+ Misses 4170 4151 -19 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b7d78b3 to
153d69a
Compare
153d69a to
d94153a
Compare
There was a problem hiding this comment.
More details
PR successfully removes empty FTR capture containers while safely handling edge cases. Unit test validates recursive deletion of empty fields, elements, and entries from captured values, proper handling of property name collisions, and preservation of metadata. No behavioral regressions identified.
📊 Validated against 15 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit d94153a · What is Autotest? · Any feedback? Reach out in #autotest
What does this PR do?
Omits empty capture containers from Failed Test Replay DI snapshots before they are sent through the Test Optimization logs path. This keeps captured object and collection types while avoiding empty or null
fields,elements, andentriespayloads that can break debugger UI rendering.The cleanup now only prunes recognized captured values and traverses all remaining object-valued children, so application variables or properties named
fields,elements, orentriescannot block recursive cleanup.This also adds coverage for the raw serialized FTR DI log body, verifying that captured empty objects, arrays, and maps preserve their
typewhile omitting empty containers. The existing raw log assertions also confirm gitddtagsare present for the covered FTR paths.Motivation
FTR snapshots can include empty captured objects and collections. In the Test Optimization logs flow, those empty containers may surface as
fields: null,elements: null, orentries: nullin the debugger UI, causing capture rendering failures.Additional Notes
Verification covers the worker snapshot cleanup matrix, recursive name-collision cases, metadata preservation, and a Jest FTR integration path that inspects the raw DI log body received by the fake intake.