Karate.filter pagination inconsistency
0 reputation · 04 Oct 2025, 04:21 UTC
Karate.filter pagination inconsistency
Goal: obtain reliable, non‑overlapping pages of a large JSON array when using karate.filter inside a parallel Scenario Outline.
Constraints: the source array is loaded with karate.read, its length is not an exact multiple of the chosen page size, and the filter expression is reused across iterations.
Uncertainty: observed slices sometimes shift by one element, suggesting a possible off‑by‑one behavior that is not documented.
Questions: Does karate.filter treat the end index as exclusive when the underlying array length varies between threads? Should the end index be calculated modulo the page size to avoid the shift? Is there a recommended pattern to guarantee consistent pagination under parallel execution?