- 
                Notifications
    
You must be signed in to change notification settings  - Fork 25.6k
 
[TEST] Cover custom sorting and routing in randomized testing #120584
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
Conversation
| var responseBody = entityAsMap(response); | ||
| assertThat("errors in baseline bulk response:\n " + responseBody, responseBody.get("errors"), equalTo(false)); | ||
| return responseBody; | ||
| } | 
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.
All this logic feels out of place here, specific to tests using bulk indexing.. It probably belongs more to a sibling of ReindexChallengeRestIT, like BulkChallengeRestIT. Thoughts?
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.
Went ahead with this refactoring, ptal.
… logsdb/random-test-routing
| 
           Pinging @elastic/es-storage-engine (Team:StorageEngine)  | 
    
| 
           I'll wait for this to land before merging #119994, i think it would be a much easier conflict resolve for me.  | 
    
| * mapping and documents in order to cover more code paths and permutations. | ||
| */ | ||
| public class StandardVersusLogsIndexModeRandomDataChallengeRestIT extends StandardVersusLogsIndexModeChallengeRestIT { | ||
| public abstract class StandardVersusLogsIndexModeRandomDataChallengeRestIT extends StandardVersusLogsIndexModeChallengeRestIT { | 
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.
Doesn't this effectively remove all tests that were in this class (inherited from StandardVersusLogsIndexModeChallengeRestIT)? Those are the actual logsdb vs standard random data tests.
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.
These now run in BulkChallengeRestIT that inherits from StandardVersusLogsIndexModeRandomDataChallengeRestIT.
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.
ah thanks
| 
           I have to admit i am lost in the class hierarchy here (and i majorly contributed to that) which i am not a fan of. I don't have any specific suggestion though so LGTM modulo the question above.  | 
    
| 
           Can we collapse   | 
    
          
 Not really, lemme do it and submit.  | 
    
… logsdb/random-test-routing
# Conflicts: # x-pack/plugin/logsdb/src/javaRestTest/java/org/elasticsearch/xpack/logsdb/qa/StandardVersusLogsIndexModeChallengeRestIT.java
…c#120584) * Cover custom sorting and routing in randomized testing * [CI] Auto commit changes from spotless * fix reindex tests * fix reindex tests * refactor classes * comment * more refactoring * more refactoring * restore tests with static mappings * reduce diff * reduce diff * Restore single-element array removal in synthetic source * Revert "Restore single-element array removal in synthetic source" This reverts commit e8e99e1. * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <[email protected]>
          💚 Backport successful
  | 
    
… (#120932) * Cover custom sorting and routing in randomized testing * [CI] Auto commit changes from spotless * fix reindex tests * fix reindex tests * refactor classes * comment * more refactoring * more refactoring * restore tests with static mappings * reduce diff * reduce diff * Restore single-element array removal in synthetic source * Revert "Restore single-element array removal in synthetic source" This reverts commit e8e99e1. * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <[email protected]>


Requires some refactoring due to the fact that, with routing on sort fields, ids are auto-generated. Since some tests compare base and contender results using doc ids, the auto-generated id from contender needs to be used when indexing docs on baseline side.
Related to #109334