-
Couldn't load subscription status.
- Fork 128
Extend system test to validate absence of _ignored #1738
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
Extend system test to validate absence of _ignored #1738
Conversation
| It actually looks like this check finds an error right away:
|
| ++, nice addition. The more we add of these checks, the higher the quality of integrations will be. |
| test integrations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
But let's wait to see if it would affect many existing integrations. If it does, we could introduce this only for packages using the next version of the spec.
| Created or updated PR in integrations repository to test this version. Check elastic/integrations#9439 |
| test integrations |
| Created or updated PR in integrations repository to test this version. Check elastic/integrations#9439 |
| test integrations |
| Still the same error in the test package, I will look into this |
| Created or updated PR in integrations repository to test this version. Check elastic/integrations#9439 |
| | ||
| allFieldsBody = `{"fields": ["*"]}` | ||
| DevDeployDir = "_dev/deploy" | ||
| checkFieldsBody = `{"fields": ["*"], "aggs": {"degraded": {"filter": {"exists": {"field": "_ignored"}}}}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the returned error should at a minimum include the names of ignored fields. You could aggregate those field names. (It needs a runtime field to access the names as per elastic/elasticsearch#59946 (comment)).
POST logs-*/_search { "size": 10, "runtime_mappings": { "my_ignored": { "type": "keyword", "script": { "source": "for (def v : params['_fields']._ignored.values) { emit(v); }" } } }, "aggs": { "all_ignored": { "filter": { "exists": { "field": "_ignored" } }, "aggs": { "ignore_fields": { "terms": { "size": 100, "field": "my_ignored" } } } } } } There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned I wanted to wait with this until the change to make _ignored aggregatable is merged, but you are right that we don't need to block on it - I changed the code to use the runtime field workaround for now.
| test integrations |
| The test
|
| Created or updated PR in integrations repository to test this version. Check elastic/integrations#9439 |
| test integrations |
| Created or updated PR in integrations repository to test this version. Check elastic/integrations#9439 |
| @jsoriano As the need came up in the existing failures, I opened a PR on the package-spec to add a flag to add exceptions to this test: elastic/package-spec#743 Once this is merged, I'm going to update this PR to check this definition and skip the check if it makes sense. Once this is in place, it should be possible to mute existing errors in the integrations repo and merge this PR. |
| @flash1293, I've often seen encoded payload field values exceed 6-7k characters easily. This can easily go up even more in real world scenarios and the issue is these are always clumped into 'keyword' types. We really need a way to mark 'keyword' types to have an attribute like 'ignore_length: true' or some sort or introduce a new type for storing encoded payloads, otherwise in a real scenario these fields will not get indexed after the recent changes and just addressing the test scenarios won't work. |
| @ShourieG Two questions:
|
The changes around |
@flash1293, Ah alright, I guess I misunderstood initially the issue around indexing. Then maybe adding the 'ignore_length: true' to the package spec so we can specify that during the tests would be pretty awesome? Something that we can specify in the validation.yml ? |
| @ShourieG Currently working on it here: elastic/package-spec#743 |
| Muting existing failures here: elastic/integrations#9823 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the work here! Feel free to merge the change in the spec too.
| /ci |
| @jsoriano it seems like the build failed, how can I trigger it again? It doesn't look related to the changes of the PR |
You can write a The failure happening now is in a package whose tests use to be flaky, so probably the failure is not related. |
| /test |
| /test |
1 similar comment
| /test |
💚 Build Succeeded
History
|

Closes #1276
This PR adds a check whether any indexed docs have an
_ignoredfield - this would indicate a mapping problem:Example output:
How to test
Cause a mapping error by configuring a field in a wrong way - I used the
celpackage:As message is longer than 5 characters, this will cause
messageto not be mapping correctly. Running the system tests forcelwill fail with the error shown above.Notes
The check is done via aggregations instead of checking through each documents to be able to validate all docs, not just the ones that are fetched (which are capped at 500). Once elastic/elasticsearch#101373 is merged, we can use a terms query here for better debug information (but it's also possible to check the index manually to find the root cause).
This cannot be meaningfully applied to the pipeline tests currently, as they don't take mappings into account (elastic/elasticsearch#99920).