Skip to content

Commit 66c0025

Browse files
committed
docs(tests): add test cases for incident loading and related tooltip time display issues
- Add test case for boundary end times not rounded to 5 minutes (OU-1205) Interval calculation uses 1-second offsets causing unrounded times like "23:29:59" instead of "23:30" in multi-severity incident tooltips - Add test case for start times mismatch between UI elements (OU-1221) Multi-severity incident tooltip start times are 5 minutes off from alert tooltip and alerts table values - Document absolute start date fix implementation using new API call (OU-1040) Uses min_over_time(timestamp()) instant queries to retrieve actual start timestamps regardless of "Last N Days" filter selection
1 parent c9c309e commit 66c0025

2 files changed

Lines changed: 103 additions & 2 deletions

File tree

docs/incident_detection/tests/2.ui_display_flows.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,74 @@ start,end,alertname,namespace,severity,silenced,labels
109109
- Check the "last updated date" field
110110
- Verify that the format changes without the need to reload the page
111111

112+
### 2.3.2 Incident Bar Trimming on Time Filter Change
113+
**BUG**: When "Last N Days" is shorter than an incident's duration, the bar should be visually trimmed to show only the portion within the selected time window.
114+
**Automation Status**: NOT AUTOMATED
115+
116+
**Background**:
117+
- Incorrect behavior: Changing time filter "squashes" the X-axis to the right while still showing the full incident bar
118+
- Correct behavior: Incident bar is trimmed/clipped to only display the portion that falls within the selected time range
119+
120+
- [ ] **Bar Trimming - Long Incident with Short Filter**: Create an incident spanning 15 days
121+
- With "Last 15 days": Full incident bar visible with correct proportional width
122+
- Set time filter to "Last 7 days"
123+
- Verify the incident bar is trimmed to show only the 7-day portion (not the full 15-day bar)
124+
- Verify the X-axis scale matches the 7-day window (not squashed to the right)
125+
- Verify the bar starts at the left edge of the chart (since incident started before the 7-day window)
126+
127+
- [ ] **Tooltip Accuracy After Trimming**: Hover over a trimmed incident bar
128+
- Verify tooltip shows the actual absolute Start date (which may be before the visible window)
129+
- Verify tooltip shows correct End date
130+
- Verify the displayed duration reflects the full incident, not just the visible portion
131+
132+
### 2.3.3 Mixed Severity Interval Boundary Times
133+
**Automation Status**: NOT AUTOMATED
134+
135+
This section covers two related time display bugs in multi-severity incident tooltips.
136+
137+
#### Issue 1: Boundary End Times Not Rounded (OU-1205)
138+
**BUG**: Consecutive interval end times within the same incident bar are not 5-minute rounded in tooltips.
139+
140+
**Background**:
141+
- The interval calculation logic in `utils.ts` uses 1-second offsets to prevent overlapping intervals
142+
- Example: If timestamps are at 100, 200, 300 seconds, intervals are calculated as:
143+
- Interval 1: [100, 199, 'critical']
144+
- Interval 2: [200, 299, 'warning']
145+
- This results in end times like "23:29:59" instead of the expected rounded "23:30"
146+
- The fix should round the displayed tooltip text, not change the interval calculation logic
147+
148+
- [ ] **End Times Should Be 5-Minute Rounded**: Use AlertC from test data (multi-severity incident)
149+
- Hover over each severity segment within the incident bar
150+
- Verify End time in tooltip shows rounded value (e.g., "23:30") not unrounded (e.g., "23:29:59")
151+
- Verify all interval boundaries display at 5-minute precision in tooltips
152+
153+
#### Issue 2: Start Times 5 Minutes Off (OU-1221)
154+
**BUG**: Multi-severity incident bar tooltip start times are 5 minutes off from the values shown in alert tooltips and alerts table.
155+
156+
**Background**:
157+
- When hovering over a severity segment in an incident bar, the Start time shown differs from:
158+
- The Start time shown in the corresponding alert tooltip
159+
- The Start time shown in the alerts details table
160+
- This creates user confusion as the same data point shows different times in different UI elements
161+
162+
- [ ] **Start Times Match Alert Tooltip**: Use AlertC from test data
163+
- Click incident to open alerts chart
164+
- Hover over an alert bar: Note the Start time in alert tooltip
165+
- Hover over the corresponding severity segment in the incident bar
166+
- Verify incident tooltip Start time matches alert tooltip Start time exactly
167+
168+
- [ ] **Start Times Match Alerts Table**:
169+
- With incident selected, check alerts table Start column
170+
- Hover over the corresponding severity segment in incident bar
171+
- Verify incident tooltip Start time matches alerts table Start time exactly
172+
173+
- [ ] **Consecutive Interval Boundaries Match**: Check multi-severity incident
174+
- Hover over first severity segment: Note the End time
175+
- Hover over next severity segment: Note the Start time
176+
- Verify End time of previous segment matches Start time of next segment (no 5-minute gap)
177+
- Example failure: Info ends at "10:15" but Warning starts at "10:20"
178+
- Expected: Info ends at "10:15" and Warning starts at "10:15"
179+
112180
### 2.4 Silences labels (Not Automated)
113181
- Verify that information about silences is contained in the alert name
114182
as `NetworkLatencyHigh (silenced)` instead of the additional `silenced=true`

docs/incident_detection/tests/3.api_calls_data_loading_flows.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,41 @@ start,end,alertname,namespace,severity,silenced,labels
8484
- Verify the latest query end time param is within the last 5 minutes
8585

8686

87-
### 3.4 Data Integrity
88-
**NEW, NOT AUTOMATED, TODO COO 1.4**
87+
### 3.4 15-Day Data Loading with "Last N Days" Filtering
88+
**FEATURE**: UI always loads 15 days of data (one query_range call per day), then filters client-side based on "Last N Days" selection.
89+
**Automation Status**: NOT AUTOMATED
90+
91+
**Background**:
92+
- Before: Data was downloaded only for "Last N Days", causing Start dates to be relative to N days
93+
- After: Start displays an absolute date, even when "Last N Days" is shorter than the incident's actual start
94+
- Limit: Start is capped at max 15 days (the maximum supported range)
95+
96+
**Fix Implementation**:
97+
The absolute start date of an incident/alert is always displayed, regardless of the selected "Last N Days" filter.
98+
99+
Solution uses a new API call:
100+
- Absolute timestamps are retrieved by performing an **instant query** call to Prometheus
101+
- For incidents: `min_over_time(timestamp(cluster_health_components_map{}))`
102+
- For alerts: `min_over_time(timestamp(ALERTS{}))`
103+
- This returns the timestamp of the first datapoint for that metric
104+
- The result is saved into Redux store and matched to related incident/alert to update the Start date displayed in the tooltip
105+
106+
**Manual Testing Data**:
107+
Use `docs/incident_detection/simulate_scenarios/long-incident-15-days.csv` which creates a 15-day spanning incident for testing absolute start date display.
108+
109+
- [ ] **Absolute Start Date Display**: Use `long-incident-15-days.csv` (creates 15-day incident)
110+
- Set time filter to "Last 7 days"
111+
- Verify incident Start date shows the absolute date (15 days ago), NOT a date relative to 7 days
112+
- Verify the incident bar in the chart is trimmed to show only the portion within the 7-day window
113+
- Verify tooltip shows the actual absolute start time
114+
115+
- [ ] **API Call Pattern Verification**: Monitor network requests on initial page load
116+
- Verify 15 query_range calls are made on initial page load (one per day)
117+
- Verify instant query calls for `min_over_time(timestamp(cluster_health_components_map{}))` and `min_over_time(timestamp(ALERTS{}))`
118+
- Verify the time ranges cover the full 15-day window regardless of "Last N Days" selection
119+
120+
### 3.5 Data Integrity
121+
**NEW, NOT AUTOMATED, TODO COO 1.4**
89122
- [ ] Incident grouping by `group_id` works correctly
90123
- [ ] Values deduplicated across multiple time range queries
91124
- [ ] Component lists combined for same group_id

0 commit comments

Comments
 (0)