MOB-53647 Aggregator: propagate extend-aggregation to nested underlings - #2022
Conversation
Root cause: ApiritifLoadReader extends ConsolidatingAggregator and is
added as an underling of the outer ConsolidatingAggregator. The outer's
startup() calls set_aggregation(True) on the inner, but the inner's own
startup() is never called by the engine — so the inner's underlings
(JTLReader) never received _redundant_aggregation=True.
Without the flag, JTLReader's __add_sample skips get_mixed_label(),
producing raw labels (e.g. "Navigate to site") without the required
"-state" suffix. When the outer's converter runs __extend_reported_data,
key.rindex('-') raises ValueError.
Fix: set_aggregation() now recursively propagates to nested underlings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, matches the stated root cause, and is covered by a targeted regression test.
Pull request overview
This PR fixes a crash in Taurus’ ConsolidatingAggregator when extend-aggregation: true is used in nested aggregation setups (e.g., outer engine aggregator → ApiritifLoadReader → JTLReader). The core change ensures the “redundant aggregation” flag is propagated recursively so nested readers generate mixed labels with the expected -state suffix, preventing ValueError in __extend_reported_data.
Changes:
- Recursively propagate
set_aggregation()to nested underlings so inner aggregators forward the flag to their own readers. - Add a unit test that constructs an outer→inner→reader chain and asserts flag propagation and
-statesuffixed labels.
File summaries
| File | Description |
|---|---|
bzt/modules/aggregator.py |
Makes ResultsProvider.set_aggregation() propagate the flag through nested underlings, fixing the crash scenario. |
tests/unit/modules/test_consolidatingAggregator.py |
Adds regression coverage for nested-aggregator propagation and mixed-label generation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2022 +/- ##
==========================================
+ Coverage 88.19% 88.19% +0.01%
==========================================
Files 75 75
Lines 21162 21164 +2
==========================================
+ Hits 18661 18663 +2
Misses 2501 2501 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Fixes
ValueError: substring not foundcrash in__extend_reported_datawhenextend-aggregation: trueis enabled for BBT (selenium) tests.Root Cause
ApiritifLoadReaderextendsConsolidatingAggregatorand is added as an underling of the outerConsolidatingAggregator. The chain:The outer's
startup()propagates_redundant_aggregation=Trueto the inner viaset_aggregation(). But the inner'sstartup()is never called by the engine (it's just an underling, not a module). So the inner never propagates the flag to its underlings (JTLReader).Without the flag, JTLReader's
__add_sampleskipsget_mixed_label(), producing raw labels like"Navigate to site"without the required-statesuffix. When the outer'sconverterruns__extend_reported_data,key.rindex('-')raisesValueError.Fix
set_aggregation()now recursively propagates to nested underlings:No risk of infinite loop — the underling tree is a DAG (directed acyclic graph). Leaf nodes like
JTLReaderhaveunderlings = [], so recursion terminates. Underlings never reference their parent, so no cycles are possible.Test plan
test_nested_aggregator_propagates_extend_aggregation— verifies flag propagation and mixed labelsCompanion fix: Blazemeter/a.blazemeter.com#8329 (allows BBT executors in
isTransactionFilterAllowed)🤖 Generated with Claude Code