Skip to content

Conversation

@cbuescher
Copy link
Member

Previuosly SearchRequest#source would rarely be null because the empty
constructor was used. We shouldn't use that constructor in the test.

Closes #28388

@cbuescher cbuescher added >test Issues or PRs that are addressing/adding tests review v5.6.8 labels Jan 26, 2018
@cbuescher cbuescher requested a review from javanna January 26, 2018 14:47
@cbuescher
Copy link
Member Author

I think this cannot happen on 6.x and master because we already use SearchRequest(indices) there. However I was wondering if we can get rid of the empty ctor or set the source to something other than null in that case. Maybe something for a follow up PR.

@cbuescher cbuescher changed the title [Tests] Fix RequestTest NPE [Tests] Fix RequestTests NPE Jan 26, 2018
Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM . Given that the SearchRequest empty constructor is public, maybe we should have a small test that verifies that things don't break when the source is null. I am not sure that is tested once this change is made. (that should also be applied to master and 6.x).

@cbuescher
Copy link
Member Author

@javanna good point, I opened #28393 to track this.

@cbuescher
Copy link
Member Author

Will need to fix CI failure first...

Previuosly SearchRequest#source would rarely be null because the empty
constructor was used. We shouldn't use that constructor in the test.

Closes elastic#28388
@cbuescher cbuescher force-pushed the fix-requestTests-NPE branch from ba345de to 325b187 Compare January 29, 2018 10:21
@cbuescher
Copy link
Member Author

CI still fails because our PR testing infra currently builds pull request against 5.6 with the wrong JDK (9 instead of 8). However, the changed test passes locally and also in CI, so I'm going to merge this.

@cbuescher cbuescher merged commit 0b1faef into elastic:5.6 Jan 29, 2018
@cbuescher
Copy link
Member Author

Still failing on 6.1 (https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+6.1+multijob-unix-compatibility/os=debian/266/console) so I'm going to port it there and also check the other 6.x branches again if this can happen there.

cbuescher pushed a commit that referenced this pull request Jan 31, 2018
Previuosly SearchRequest#source would rarely be null because the empty
constructor was used. We shouldn't use that constructor in the test.

Closes #28388
cbuescher pushed a commit that referenced this pull request Jan 31, 2018
Previuosly SearchRequest#source would rarely be null because the empty
constructor was used. We shouldn't use that constructor in the test.

Closes #28388
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 v5.6.8 v6.0.3 v6.1.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants