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

Tests: Add unit test for InternalChildren #23261

Merged
merged 2 commits into from
Feb 20, 2017

Conversation

cbuescher
Copy link
Member

Relates to #22278

@cbuescher cbuescher added review >test Issues or PRs that are addressing/adding tests v6.0.0-alpha1 labels Feb 20, 2017
Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

LGTM, just one minor comment about random parameter generation.

protected InternalChildren createTestInstance(String name, List<PipelineAggregator> pipelineAggregators,
Map<String, Object> metaData) {
// we shouldn't use the full long range here since we sum doc count on reduce, and don't want to overflow the long range there
long docCount = Math.abs(randomInt());
Copy link
Contributor

Choose a reason for hiding this comment

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

if randomInt() returns -2^31 then docCount will be negative (since the absolute value cannot be represented as an int in that case)

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, will change that to a positive int then.

@cbuescher
Copy link
Member Author

Merging this, CI seems stuck but local tests passed.

@cbuescher cbuescher merged commit ea9d511 into elastic:master Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test Issues or PRs that are addressing/adding tests v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants