Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from
Jan 19, 2025

Conversation

reiabreu
Copy link
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
Copy link
Contributor

rzo1 commented Jan 19, 2025

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
12 checks passed
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