@@ -774,6 +774,7 @@ class RollupRunnerIT : RollupRestTestCase() {
774774 )
775775 ).let { createRollup(it, it.id) }
776776
777+ // First run, backing index is empty: no mappings, no rollup_index setting, no rollupjobs in _META
777778 updateRollupStartTime(rollup)
778779
779780 waitFor { assertTrue(" Target rollup index was not created" , indexExists(backingIndex)) }
@@ -785,13 +786,18 @@ class RollupRunnerIT : RollupRestTestCase() {
785786 assertEquals(" Rollup is not finished" , RollupMetadata .Status .FINISHED , rollupMetadata.status)
786787 rollupJob
787788 }
789+ var rollupMetadataID = startedRollup.metadataID!!
790+ var rollupMetadata = getRollupMetadata(rollupMetadataID)
791+ assertEquals(" Did not process any doc during rollup" , rollupMetadata.stats.documentsProcessed > 0 )
788792
789793 // restart job
790794 client().makeRequest(
791795 " PUT" ,
792796 " $ROLLUP_JOBS_BASE_URI /${startedRollup.id} ?if_seq_no=${startedRollup.seqNo} &if_primary_term=${startedRollup.primaryTerm} " ,
793797 emptyMap(), rollup.copy(enabled = true ).toHttpEntity()
794798 )
799+ // Second run, backing index is setup just like any other rollup index
800+ updateRollupStartTime(rollup)
795801
796802 startedRollup = waitFor {
797803 val rollupJob = getRollup(rollupId = rollup.id)
@@ -801,11 +807,12 @@ class RollupRunnerIT : RollupRestTestCase() {
801807 rollupJob
802808 }
803809
804- val rollupMetadataID = startedRollup.metadataID!!
805- val rollupMetadata = getRollupMetadata(rollupMetadataID)
810+ rollupMetadataID = startedRollup.metadataID!!
811+ rollupMetadata = getRollupMetadata(rollupMetadataID)
812+
813+ assertEquals(" Did not process any doc during rollup" , rollupMetadata.stats.documentsProcessed > 0 )
814+
806815
807- // 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
808- assertTrue(" Did not have less than 100 pages processed" , rollupMetadata.stats.documentsProcessed > 0 )
809816 }
810817
811818 // TODO: Test scenarios:
0 commit comments