[Uptime] Fix timespan referencing to same values (#56601)#56612
Conversation
|
Pinging @elastic/uptime (Team:uptime) |
|
What's the end result to the behavior of the application? This seems like a bug that CI should have caught before it was merged, if I'm understanding the code change correctly. |
💚 Build SucceededTo update your PR or re-run it, just comment with: |
So because of using the same object, it was subtracting 5 minutes from both dates, hence setting timespan to 5 minutes in the past, because of that we are getting results which are always 5 minutes ago. @justinkambic Well it's related to that timespan andrew increased and relative time handling i did. So CI won't be able to catch it since it just increases or reduces timespan. |
|
@andrewvc can probably add more why this wasn't go caught in CI, or how can we improve the tests for it. |
|
The reason this was missed, most likely, is that we do a time intersection. So, the bug here resulted in a zero length point which still intersected the most recent checks (most likely). What we need to add is a test that checks that we still match data that's somewhat stale. So, in other words do the query on a dataset that has data with timespans ending say a minute ago. I'm OK with merging this as-is given where we are in the FF with manual testing, but we'll need to add a CI test here as well. |
|
For the CI test, to be clear, I'm OK adding it after merging this PR. |
andrewvc
left a comment
There was a problem hiding this comment.
LGTM, tested locally on this branch and master by setting a time range of last '15s'. This breaks without this patch.
Add Unit tests for the QueryContext class that was missing testing. This would have caught #56612
) Add Unit tests for the QueryContext class that was missing testing. This would have caught elastic#56612
Summary
Fixes Timespan using same object for tsStart and tsEnd in Monitor List API !!
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers