Skip to content

Commit

Permalink
reduced pageSize to 1 in few ITs to avoid flaky tests; fixed bug wher…
Browse files Browse the repository at this point in the history
…e pagesProcessed was calculated incorrectly

Signed-off-by: Petar Dzepina <petar.dzepina@gmail.com>
  • Loading branch information
petardz committed Aug 31, 2022
1 parent c3e2cbc commit af8f4c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class TransformSearchService(
val aggs = searchResponse.aggregations.get(transform.id) as CompositeAggregation
val buckets = if (modifiedBuckets != null) aggs.buckets.filter { modifiedBuckets.contains(it.key) } else aggs.buckets
val documentsProcessed = buckets.fold(0L) { sum, it -> sum + it.docCount }
val pagesProcessed = 1L
val pagesProcessed = if (buckets.isNotEmpty()) 1L else 0L
val searchTime = searchResponse.took.millis
val stats = TransformStats(pagesProcessed, documentsProcessed, 0, 0, searchTime)
val afterKey = aggs.afterKey()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TransformRunnerIT : TransformRestTestCase() {
sourceIndex = "transform-source-index",
targetIndex = "transform-target-index",
roles = emptyList(),
pageSize = 100,
pageSize = 1,
groups = listOf(
Terms(sourceField = "store_and_fwd_flag", targetField = "flag")
)
Expand Down Expand Up @@ -86,7 +86,7 @@ class TransformRunnerIT : TransformRestTestCase() {
sourceIndex = "transform-source-index",
targetIndex = "transform-target-index",
roles = emptyList(),
pageSize = 100,
pageSize = 1,
groups = listOf(
Terms(sourceField = "store_and_fwd_flag", targetField = "flag")
),
Expand Down

0 comments on commit af8f4c3

Please sign in to comment.