Skip to content

StormExecutor: adding an unit test to changes introduced in STORM-3693 #3834

Merged
rzo1 merged 9 commits into
apache:masterfrom
reiabreu:master
Jan 19, 2025
Merged

StormExecutor: adding an unit test to changes introduced in STORM-3693 #3834
rzo1 merged 9 commits into
apache:masterfrom
reiabreu:master

Conversation

@reiabreu

Copy link
Copy Markdown
Contributor

What is the purpose of the change

StormExecutor: adding an unit test to check if the RotatingMap' rotate is called only once when timing out tuples.

StormExecutor requires a considerable effort to mock and the pending map (which is RotatingMap) is an internal attribute. JUnit's reflection was used to mock the RotationMap and verify how many times rotate was called.

This test is far from optimal and I'm not a fan of using reflection, but will make it easier to detect regressions.
The test should be refactored in the future.

Additionally, refactored the changes introduced in #3828: boolean isSpout = this instanceof SpoutExecutor; should not be in Executor. A parent class should not have references to subclasses

How was the change tested

mvn clean install. All tests are passing.

@reiabreu reiabreu requested a review from rzo1 January 18, 2025 23:52
@rzo1

rzo1 commented Jan 19, 2025

Copy link
Copy Markdown
Contributor

This test is far from optimal and I'm not a fan of using reflection, but will make it easier to detect regressions.
The test should be refactored in the future.

Maybe add an issue for it, so we can keep tracking it. Note: INFRA will soon migrate to GitHub Issues :)

@rzo1 rzo1 merged commit 884c4cd into apache:master Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants