Skip to content

Commit

Permalink
passes all integ tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ronnak Saxena <ronsax@amazon.com>
  • Loading branch information
ronnaksaxena committed Sep 5, 2023
1 parent c9ca74b commit 3e04b91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ResponseInterceptor(
// Need to avoid infinite interceptor loop
val req = SearchRequest()
.source(searchSourceBuilder)
rollupIndices.forEach { req.indices(it) }
.indices(*rollupIndices)
var res: SearchResponse? = null
val latch = CountDownLatch(1)
client.search(
Expand Down Expand Up @@ -191,7 +191,7 @@ class ResponseInterceptor(
// Need to avoid infinite interceptor loop
val maxRolledDateRequest = SearchRequest()
.source(searchSourceBuilder)
rollupIndices.forEach { maxRolledDateRequest.indices(it) } // add all rollup indices to this request
.indices(*rollupIndices) // add all rollup indices to this request
var maxRolledDateResponse: SearchResponse? = null
var latch = CountDownLatch(1)
client.search(
Expand Down Expand Up @@ -221,7 +221,7 @@ class ResponseInterceptor(
If the response shard index is a live index, need to only compute minimum value of the current shard index
*/
if (isShardIndexRollup) {
liveIndices.forEach { minLiveDateRequest.indices(it) }
minLiveDateRequest.indices(*liveIndices)
} else { // shard index is live index
minLiveDateRequest.indices(shardRequestIndex)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1045,21 +1045,6 @@ class RollupInterceptorIT : RollupRestTestCase() {
}
}
""".trimIndent()
// Search 1 non-rollup index and 1 rollup
val searchResult1 = client().makeRequest("POST", "/$sourceIndex2,$targetIndex2/_search", emptyMap(), StringEntity(req, ContentType.APPLICATION_JSON))
assertTrue(searchResult1.restStatus() == RestStatus.OK)
val failures = extractFailuresFromSearchResponse(searchResult1)
assertNotNull(failures)
assertEquals(1, failures?.size)
assertEquals(
"Searching multiple indices where one is rollup and other is not, didn't return failure",
"illegal_argument_exception", failures?.get(0)?.get("type") ?: "Didn't find failure type in search response"

)
assertEquals(
"Searching multiple indices where one is rollup and other is not, didn't return failure",
"Not all indices have rollup job", failures?.get(0)?.get("reason") ?: "Didn't find failure reason in search response"
)

// Search 2 rollups with different mappings
try {
Expand Down

0 comments on commit 3e04b91

Please sign in to comment.