Skip to content

Commit

Permalink
added test for alias in target_index
Browse files Browse the repository at this point in the history
Signed-off-by: Petar Dzepina <[email protected]>
  • Loading branch information
petardz committed Aug 9, 2022
1 parent e0d03eb commit caa694d
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ class RollupRunnerIT : RollupRestTestCase() {
)
).let { createRollup(it, it.id) }

// First run, backing index is empty: no mappings, no rollup_index setting, no rollupjobs in _META
updateRollupStartTime(rollup)

waitFor { assertTrue("Target rollup index was not created", indexExists(backingIndex)) }
Expand All @@ -785,13 +786,18 @@ class RollupRunnerIT : RollupRestTestCase() {
assertEquals("Rollup is not finished", RollupMetadata.Status.FINISHED, rollupMetadata.status)
rollupJob
}
var rollupMetadataID = startedRollup.metadataID!!
var rollupMetadata = getRollupMetadata(rollupMetadataID)
assertEquals("Did not process any doc during rollup", rollupMetadata.stats.documentsProcessed > 0)

// restart job
client().makeRequest(
"PUT",
"$ROLLUP_JOBS_BASE_URI/${startedRollup.id}?if_seq_no=${startedRollup.seqNo}&if_primary_term=${startedRollup.primaryTerm}",
emptyMap(), rollup.copy(enabled = true).toHttpEntity()
)
// Second run, backing index is setup just like any other rollup index
updateRollupStartTime(rollup)

startedRollup = waitFor {
val rollupJob = getRollup(rollupId = rollup.id)
Expand All @@ -801,11 +807,12 @@ class RollupRunnerIT : RollupRestTestCase() {
rollupJob
}

val rollupMetadataID = startedRollup.metadataID!!
val rollupMetadata = getRollupMetadata(rollupMetadataID)
rollupMetadataID = startedRollup.metadataID!!
rollupMetadata = getRollupMetadata(rollupMetadataID)

assertEquals("Did not process any doc during rollup", rollupMetadata.stats.documentsProcessed > 0)


// Randomly choosing 100.. if it didn't work we'd either fail hitting the timeout in waitFor or we'd have thousands of pages processed
assertTrue("Did not have less than 100 pages processed", rollupMetadata.stats.documentsProcessed > 0)
}

// TODO: Test scenarios:
Expand Down

0 comments on commit caa694d

Please sign in to comment.