mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
[TEST] fix random preference string tests to accomodate for the new more strict preference type
This commit is contained in:
parent
d0d1b98d23
commit
0bd774423d
@ -53,7 +53,11 @@ public class RandomScoreFunctionTests extends ElasticsearchIntegrationTest {
|
||||
int outerIters = scaledRandomIntBetween(10, 20);
|
||||
for (int o = 0; o < outerIters; o++) {
|
||||
final long seed = randomLong();
|
||||
final String preference = randomRealisticUnicodeOfLengthBetween(1, 10); // at least one char!!
|
||||
String preference = randomRealisticUnicodeOfLengthBetween(1, 10); // at least one char!!
|
||||
// randomPreference should not start with '_' (reserved for known preference types (e.g. _shards, _primary)
|
||||
while (preference.startsWith("_")) {
|
||||
preference = randomRealisticUnicodeOfLengthBetween(1, 10);
|
||||
}
|
||||
int innerIters = scaledRandomIntBetween(2, 5);
|
||||
SearchHits hits = null;
|
||||
for (int i = 0; i < innerIters; i++) {
|
||||
|
@ -66,8 +66,13 @@ public class SimpleSearchTests extends ElasticsearchIntegrationTest {
|
||||
|
||||
int iters = scaledRandomIntBetween(10, 20);
|
||||
for (int i = 0; i < iters; i++) {
|
||||
String randomPreference = randomUnicodeOfLengthBetween(0, 4);
|
||||
// randomPreference should not start with '_' (reserved for known preference types (e.g. _shards, _primary)
|
||||
while (randomPreference.startsWith("_")) {
|
||||
randomPreference = randomUnicodeOfLengthBetween(0, 4);
|
||||
}
|
||||
// id is not indexed, but lets see that we automatically convert to
|
||||
SearchResponse searchResponse = client().prepareSearch().setQuery(QueryBuilders.matchAllQuery()).setPreference(randomUnicodeOfLengthBetween(0, 4)).get();
|
||||
SearchResponse searchResponse = client().prepareSearch().setQuery(QueryBuilders.matchAllQuery()).setPreference(randomPreference).get();
|
||||
assertHitCount(searchResponse, 6l);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user