Skip to content

Add a builder class for TestDruidCoordinatorConfig#12624

Merged
capistrant merged 5 commits into
apache:masterfrom
capistrant:TestDruidCoordinatorConfig-Builder
Jun 16, 2022
Merged

Add a builder class for TestDruidCoordinatorConfig#12624
capistrant merged 5 commits into
apache:masterfrom
capistrant:TestDruidCoordinatorConfig-Builder

Conversation

@capistrant
Copy link
Copy Markdown
Contributor

@capistrant capistrant commented Jun 9, 2022

Description

Cleans up a mess in the Unit testing world. TestDruidCoordinatorConfig is instantiated all over the place. When we update DruidCoordinatorConfig we shouldn't have to be updating the constructor for the test class in a ton of places if the new config is not applicable to the test. Instead the Builder will just automatically leverage the default. This should make future PRs related to coordinator configs less littered with one line changes to constructors.


Key changed/added classes in this PR
  • TestDruidCoordinatorConfig

This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.

Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Thanks for refactoring this, @capistrant!
The code looks much cleaner now.

private final Duration coordinatorDatasourceKillPeriod;
private final Duration coordinatorDatasourceKillDurationToRetain;
private final Duration getLoadQueuePeonRepeatDelay;
private final Duration loadQueuePeonRepeatDelay;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice catch 😂

{
}

public Builder(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is this constructor used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ya, that is unused. I removed. If needed in the future it can be easily created with code gen

return this;
}

//TODO add mising fields to both TEst and builder.build investigate loadTimeoutDelay naming in Test. Migrate usage to builder.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unresolved TODO?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah, I actually did the work but forgot to remove my reminder. deleted.

Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

On second glance, there seem to be some minor things that need to be addressed. :)


public Builder withHttpLoadQueuePeonHostTimeout(Duration withHttploadQueuePeonHostTimeout)
public Builder withHttpLoadQueuePeonHostTimeout(Duration httpLoadQueuePeonHostTimeout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: extra newline.

Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Thanks for fixing it up.
+1 after CI passes.

@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Jun 10, 2022

This PR and several others are failing the packaging check with this message:

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.3:install-node-and-npm (install-node-and-npm) on project druid-console: Could not extract the Node archive: Could not extract archive: '/home/travis/.m2/repository/com/github/eirslett/node/14.19.0/node-14.19.0-linux-x64.tar.gz': EOFException -> [Help 1]

I think #12632 should fix this issue.

@capistrant capistrant merged commit 602d95d into apache:master Jun 16, 2022
@abhishekagarwal87 abhishekagarwal87 added this to the 24.0.0 milestone Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants