Skip to content

Fix flaky test for dynamic mapping#227

Open
rayshrey wants to merge 2 commits into
Bukhtawar:unified-arrow-allocatorfrom
rayshrey:flaky-it-fix
Open

Fix flaky test for dynamic mapping#227
rayshrey wants to merge 2 commits into
Bukhtawar:unified-arrow-allocatorfrom
rayshrey:flaky-it-fix

Conversation

@rayshrey

Copy link
Copy Markdown

Description

[Describe what this change achieves]

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: rayshrey <rayshrey@amazon.com>
Comment on lines +187 to +193
assertBusy(() -> {
GetMappingsResponse extraMappingsResponse = client().admin().indices().prepareGetMappings(INDEX_NAME).get();
Map<String, Object> extraMappingSource = extraMappingsResponse.mappings().get(INDEX_NAME).sourceAsMap();
@SuppressWarnings("unchecked")
Map<String, Object> finalProperties = (Map<String, Object>) extraMappingSource.get("properties");
assertTrue("Mapping should contain dynamic field 'dynamic_extra'", finalProperties.containsKey("dynamic_extra"));
});

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Duplicate logic?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The field name are different but yes can create a helper function which takes a list of field name to assert on. Let me add that

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done. Updated in the latest revision.

Signed-off-by: rayshrey <rayshrey@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants