Skip to content

Tests: Add unit test for InternalChildren#23261

Merged
cbuescher merged 2 commits intoelastic:masterfrom
cbuescher:addInternalChildrenTests
Feb 20, 2017
Merged

Tests: Add unit test for InternalChildren#23261
cbuescher merged 2 commits intoelastic:masterfrom
cbuescher:addInternalChildrenTests

Conversation

@cbuescher
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

Merging this, CI seems stuck but local tests passed.

@cbuescher cbuescher merged commit ea9d511 into elastic:master Feb 20, 2017
@cbuescher cbuescher deleted the addInternalChildrenTests branch November 27, 2025 10:27
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