Skip to content
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

Increase probability of synthetic source tests using ignore_malformed #109711

Merged

Conversation

lkts
Copy link
Contributor

@lkts lkts commented Jun 13, 2024

In scope of ongoing work on ignore_malformed support in synthetic source (#106483) i noticed that rarely() used in synthetic source tests to determine application of ignore_malformed is indeed very rare. Based on my testing it has a probability significantly lower than 1%. Given that a lot of fields now have support for malformed values in synthetic source it seems reasonable to exercise this code more often. This PR changes the logic to apply ignore_malformed in 5% of tests.

@lkts lkts added >test Issues or PRs that are addressing/adding tests :StorageEngine/Mapping The storage related side of mappings labels Jun 13, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

One comment. Feel free to merge after addressing it. Thanks @lkts.

@@ -1268,6 +1267,11 @@ public final void testSyntheticEmptyList() throws IOException {
assertThat(syntheticSource(mapper, b -> b.startArray("field").endArray()), equalTo(expected));
}

private boolean shouldUseIgnoreMalformed() {
// 5% of test runs use ignore_malformed
return supportsIgnoreMalformed() && randomDouble() >= 0.05;
Copy link
Member

Choose a reason for hiding this comment

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

should be <= instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow, of course. I guess it's a good stress test to run this on CI :)

@lkts
Copy link
Contributor Author

lkts commented Jun 13, 2024

@elasticmachine update branch

@lkts
Copy link
Contributor Author

lkts commented Jun 17, 2024

@elasticmachine update branch

@lkts lkts merged commit bbcf730 into elastic:main Jun 17, 2024
15 checks passed
@lkts lkts deleted the increase_malformed_synthetic_source_test_probability branch June 17, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:StorageEngine/Mapping The storage related side of mappings Team:StorageEngine >test Issues or PRs that are addressing/adding tests v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants