Skip to content

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented Oct 23, 2017

Multifields parser does not allow duplicate values, however the MultiFieldTests may produce duplicate field values.

See https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+release-tests/132/console

Multifields parser does not allow duplicate values, however the
MultiFieldTests may produce duplicate field values.

See https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+release-tests/132/console.
@dnhatn dnhatn added >non-issue >test Issues or PRs that are addressing/adding tests v7.0.0 labels Oct 23, 2017
@dnhatn dnhatn requested a review from jasontedor October 23, 2017 13:41
@dnhatn dnhatn changed the title test: avoid generating duplicate multiple fields TEST: avoid generating duplicate multiple fields Oct 23, 2017
Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM, I left one comment.

// can to unnecessary re-syncing of the mappings between the local instance and cluster state
public void testMultiFieldsInConsistentOrder() throws Exception {
String[] multiFieldNames = new String[randomIntBetween(2, 10)];
HashSet<String> seenFields = new HashSet<>();
Copy link
Member

Choose a reason for hiding this comment

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

Let's type the left-hand side as Set<String>.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I prefer to have a concrete type for local variables. I will push the change.

Copy link
Member

Choose a reason for hiding this comment

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

I think the less-specific types are better when you can get away with them so that you do not come to rely on implementation details of the concrete type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed!

@dnhatn dnhatn merged commit bf557fd into elastic:master Oct 23, 2017
@dnhatn
Copy link
Member Author

dnhatn commented Oct 23, 2017

Thanks @jasontedor, your comment is addressed.

@dnhatn dnhatn deleted the fix-duplicate-multifields-test branch October 23, 2017 14:12
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Oct 24, 2017
* master:
  Timed runnable should delegate to abstract runnable
  Expose adaptive replica selection stats in /_nodes/stats API
  Remove dangerous `ByteBufStreamInput` methods (elastic#27076)
  Blacklist Gradle 4.2 and above
  Remove duplicated test (elastic#27091)
  Update numbers to reflect 4-byte UTF-8-encoded characters (elastic#27083)
  test: avoid generating duplicate multiple fields (elastic#27080)
  Reduce the default number of cached queries. (elastic#26949)
  removed unused import
  ingest: date processor should not fail if timestamp is specified as json number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue >test Issues or PRs that are addressing/adding tests v7.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants