Skip to content

Conversation

@opensearch-trigger-bot
Copy link
Contributor

Backport 03b261a from #1528.

Problem
--------
* `nextNiceInterval()` used a “≥” check, so when the next “nice” value
  equalled `currentMin` it returned the **same** interval.
  The interval‑explorer treats an unchanged return as a terminal
  condition, so exploration stopped and `suggestForecast` failed on
  sample‑log data.
* Interval calculation anchored on the first **future** timestamp if one
  existed, whereas run‑once / real‑time forecasting anchors on the current
  time—causing the two paths to disagree on data sufficiency.

Fix
---
* Change comparison in `nextNiceInterval()` from `>=` to `>` so it always
  returns the next larger interval, letting the explorer continue.
* Anchor interval calculation on the current time (`now`) instead of any
  future date, making all forecast modes consistent.

Tests
-----
* Added IT

Signed-off-by: Kaituo Li <kaituo@amazon.com>
(cherry picked from commit 03b261a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@kaituo kaituo merged commit 4e3133c into 3.1 Jul 24, 2025
35 of 40 checks passed
@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

Attention: Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.

Project coverage is 81.72%. Comparing base (ad12ef4) to head (c9fbffc).
Report is 1 commits behind head on 3.1.

Files with missing lines Patch % Lines
...h/timeseries/rest/handler/IntervalCalculation.java 86.36% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                3.1    #1529      +/-   ##
============================================
+ Coverage     81.60%   81.72%   +0.11%     
- Complexity     6026     6047      +21     
============================================
  Files           536      536              
  Lines         24381    24401      +20     
  Branches       2490     2493       +3     
============================================
+ Hits          19897    19941      +44     
+ Misses         3246     3230      -16     
+ Partials       1238     1230       -8     
Flag Coverage Δ
plugin 81.72% <90.62%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...n/java/org/opensearch/timeseries/AnalysisType.java 100.00% <100.00%> (+20.00%) ⬆️
...earch/timeseries/rest/handler/AggregationPrep.java 72.36% <100.00%> (+0.36%) ⬆️
...h/timeseries/rest/handler/LatestTimeRetriever.java 82.47% <100.00%> (+2.90%) ⬆️
...ies/rest/handler/ModelValidationActionHandler.java 76.02% <100.00%> (ø)
...ansport/BaseSuggestConfigParamTransportAction.java 70.29% <100.00%> (+0.99%) ⬆️
...h/timeseries/rest/handler/IntervalCalculation.java 77.04% <86.36%> (+0.96%) ⬆️

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gaiksaya gaiksaya deleted the backport/backport-1528-to-3.1 branch October 27, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants