Skip to content

Comments

feat: added block stream simulator mid-block sending failure#987

Merged
Nana-EC merged 1 commit intohiero-ledger:mainfrom
AlexKehayov:523-fail-sending-mid-block
Apr 15, 2025
Merged

feat: added block stream simulator mid-block sending failure#987
Nana-EC merged 1 commit intohiero-ledger:mainfrom
AlexKehayov:523-fail-sending-mid-block

Conversation

@AlexKehayov
Copy link
Contributor

Reviewer Notes

Mid-block sending failure can be triggered by setting blockStream.midBlockFailType and blockStream.midBlockFailOffset in app.properties. midBlockFailType takes NONE/ABRUPT/EOS as values. NONE is the default value which disables the feature. ABRUPT causes a runtime exception after sending the header and a random amount of items (without the proof). Currently, EOS (end of stream) causes calling of onError after sending the header and a random amount of items because PublishStreamRequest does not support end of stream messages, only a BlockItemSet.
midBlockFailOffset takes a numeric value and sets the amount on blocks to be sent before the failing block.
Test methods for the new functionality are added.
The streamBlockItem method is removed as it was redundant.

Related Issue(s)

Closes #523

@AlexKehayov AlexKehayov marked this pull request as ready for review April 8, 2025 14:40
@AlexKehayov AlexKehayov requested review from a team as code owners April 8, 2025 14:40
@AlexKehayov AlexKehayov requested a review from jasperpotts April 8, 2025 14:40
@ata-nas ata-nas added this to the 0.9.0 milestone Apr 8, 2025
@ata-nas ata-nas added the pull request label to get past the "label required" check when no label is needed or appropriate. label Apr 8, 2025
Copy link
Member

@georgi-l95 georgi-l95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overal looks good, I left a question and suggestion.

@AlexKehayov AlexKehayov force-pushed the 523-fail-sending-mid-block branch from b9039ec to 6d38d14 Compare April 9, 2025 11:45
…lock (hiero-ledger#523)

Signed-off-by: Alex Kehayov <aleks.kehayov@limechain.tech>
@AlexKehayov AlexKehayov force-pushed the 523-fail-sending-mid-block branch from 6d38d14 to 230e8b7 Compare April 9, 2025 11:50
Copy link
Member

@georgi-l95 georgi-l95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Nana-EC
Copy link
Contributor

Nana-EC commented Apr 15, 2025

Thanks @AlexKehayov , nice work.

@Nana-EC Nana-EC merged commit 9b256f1 into hiero-ledger:main Apr 15, 2025
9 of 11 checks passed
@codecov
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff              @@
##               main     #987      +/-   ##
============================================
+ Coverage     88.33%   88.45%   +0.12%     
- Complexity      736      741       +5     
============================================
  Files           134      135       +1     
  Lines          3154     3171      +17     
  Branches        237      241       +4     
============================================
+ Hits           2786     2805      +19     
+ Misses          298      297       -1     
+ Partials         70       69       -1     
Files with missing lines Coverage Δ Complexity Δ
...config/SimulatorMappedConfigSourceInitializer.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
...block/simulator/config/data/BlockStreamConfig.java 100.00% <100.00%> (ø) 2.00 <0.00> (ø)
...block/simulator/config/types/MidBlockFailType.java 100.00% <100.00%> (ø) 1.00 <1.00> (?)
...mulator/grpc/impl/PublishStreamGrpcClientImpl.java 95.00% <100.00%> (+4.43%) 13.00 <5.00> (+4.00)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jsync-swirlds pushed a commit that referenced this pull request Apr 16, 2025
Signed-off-by: Alex Kehayov <aleks.kehayov@limechain.tech>
@AlexKehayov AlexKehayov deleted the 523-fail-sending-mid-block branch April 29, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pull request label to get past the "label required" check when no label is needed or appropriate.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support to the Block Stream Simulator to fail sending mid-block

4 participants