Skip to content

Relax floating point precision in sum tests#143641

Merged
kkrik-es merged 3 commits intoelastic:mainfrom
dnhatn:fix-irate-tests
Mar 5, 2026
Merged

Relax floating point precision in sum tests#143641
kkrik-es merged 3 commits intoelastic:mainfrom
dnhatn:fix-irate-tests

Conversation

@dnhatn
Copy link
Copy Markdown
Member

@dnhatn dnhatn commented Mar 5, 2026

The new CsvIT tests don't force-merge the test indices, unlike SpecTestCase. I think this is more correct. However, some sum tests with time-series aggregations started failing. Previously, with a single segment, time-series data was scanned in tsid+timestamp order, so the sum always added values in the same order. With multiple segments, the values are the same but the summation order is no longer guaranteed, producing floating-point differences due to non-associativity. This affects tests with sum(time-series-aggregation). This change relaxes the floating-point precision in these tests by rounding results to 6 decimal places. Once stable, we should also remove the force-merge in SpecTestCase.

Closes #143292
Closes #143616
Closes #143617
Closes #143624
Closes #143625
Closes #143631
Closes #143632
Closes #143633
Closes #143634

@dnhatn dnhatn added :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL >test Issues or PRs that are addressing/adding tests labels Mar 5, 2026
@dnhatn dnhatn requested a review from kkrik-es March 5, 2026 02:38
@dnhatn dnhatn marked this pull request as ready for review March 5, 2026 02:38
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@dnhatn dnhatn force-pushed the fix-irate-tests branch from 630308e to 5c5bb5e Compare March 5, 2026 04:58
@kkrik-es kkrik-es enabled auto-merge (squash) March 5, 2026 06:42
@dnhatn dnhatn force-pushed the fix-irate-tests branch from f9f9794 to abfdb0e Compare March 5, 2026 07:03
Updated the CSV specification to include events and pod information along with the time_bucket. Adjusted the format for bytes and time_bucket entries.
@kkrik-es kkrik-es merged commit c1cfc47 into elastic:main Mar 5, 2026
35 checks passed
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Mar 5, 2026
* Relax floating point precision in sum tests

* Refine byte values precision in CSV spec

Updated precision of byte values in k8s-timeseries-avg-over-time.csv-spec.

---------

Co-authored-by: Kostas Krikellas <131142368+kkrik-es@users.noreply.github.com>
spinscale pushed a commit to spinscale/elasticsearch that referenced this pull request Mar 6, 2026
* Relax floating point precision in sum tests

* Refine byte values precision in CSV spec

Updated precision of byte values in k8s-timeseries-avg-over-time.csv-spec.

---------

Co-authored-by: Kostas Krikellas <131142368+kkrik-es@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment