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

Add endpoint and client call to retrieve scheduled tasks info #2260

Merged
merged 6 commits into from
Jan 24, 2022

Conversation

ashdza
Copy link
Contributor

@ashdza ashdza commented Jan 21, 2022

This PR adds an endpoint to StateResource and client call to SingularityClient that enable retrieval of the current SingularityScheduledTasksInfo. SingularityScheduledTasksInfo contains the number of late task and maximum task lag, both of which will be checked in Serenity before decommissioning agents in order to implement a slow drain and prevent decommissioning too quickly.

issue: https://git.hubteam.com/HubSpot/PaaS-Run/issues/1588
context: https://hubspot.slack.com/archives/CD13L0XCY/p1642617864005200


final long start = System.currentTimeMillis();

Map<String, Boolean> queryParams = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

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

style nit, we can just put Collections.emptyMap() in the args to executeRequest for this if we aren't actually adding any params

Comment on lines 26 to 30
@Test
public void testScheduledTasksInfoEndpoint(SingularityClient singularityClient) {
final SingularityScheduledTasksInfo scheduledTasksInfo = singularityClient.getScheduledTasksInfo();
// TODO: assertion
}
Copy link
Member

Choose a reason for hiding this comment

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

We don't actually have any real unit tests set up for the SingularityClient at the moment (yes... shame on us...). If you are trying to fit unit tests in for this PR, better bet would be to write one for the stateManager.getScheduledTasksInfo(); method. The SingularityClient methods you'll likely end up testing in our staging environment instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good - I'll test the new client method in staging then and won't add the unit test here as stateManager.getScheduledTasksInfo() is not the functionality being added in this PR.

@ashdza ashdza marked this pull request as ready for review January 24, 2022 17:00
Copy link
Member

@ssalinas ssalinas left a comment

Choose a reason for hiding this comment

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

🚢

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