Skip to content

Commit

Permalink
Fix time bounds in query to address indeterminism (#566) (#568)
Browse files Browse the repository at this point in the history
* the millisecond granularity was causing bounds mismatch between 2 intervals
* made the upper bound exclusive while fetching config to fix indeterminism

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>

Signed-off-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
(cherry picked from commit 63e5f13)

Co-authored-by: Rishabh Maurya <rishabhmaurya05@gmail.com>
  • Loading branch information
1 parent 3e96dae commit f33396b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ class QueryNotificationConfigIT : PluginRestTestCase() {
// Get notification configs between initialTime..middleTime
val getFirstResponse = executeRequest(
RestRequest.Method.GET.name,
"$PLUGIN_BASE_URI/configs?last_updated_time_ms=${initialTime.toEpochMilli()}..${middleTime.toEpochMilli()}",
"$PLUGIN_BASE_URI/configs?last_updated_time_ms=${initialTime.toEpochMilli()}..${middleTime.toEpochMilli() - 1}",
"",
RestStatus.OK.status
)
Expand All @@ -553,7 +553,7 @@ class QueryNotificationConfigIT : PluginRestTestCase() {
// Get notification configs between middleTime..finalTime
val getSecondResponse = executeRequest(
RestRequest.Method.GET.name,
"$PLUGIN_BASE_URI/configs?last_updated_time_ms=${middleTime.toEpochMilli()}..${finalTime.toEpochMilli()}",
"$PLUGIN_BASE_URI/configs?last_updated_time_ms=${middleTime.toEpochMilli()}..${finalTime.toEpochMilli() - 1}",
"",
RestStatus.OK.status
)
Expand All @@ -563,7 +563,7 @@ class QueryNotificationConfigIT : PluginRestTestCase() {
// Get notification configs between finalTime..endTime
val getThirdResponse = executeRequest(
RestRequest.Method.GET.name,
"$PLUGIN_BASE_URI/configs?last_updated_time_ms=${finalTime.toEpochMilli()}..${endTime.toEpochMilli()}",
"$PLUGIN_BASE_URI/configs?last_updated_time_ms=${finalTime.toEpochMilli()}..${endTime.toEpochMilli() - 1}",
"",
RestStatus.OK.status
)
Expand All @@ -586,7 +586,7 @@ class QueryNotificationConfigIT : PluginRestTestCase() {
// Get notification configs between initialTime..middleTime
val getFirstResponse = executeRequest(
RestRequest.Method.GET.name,
"$PLUGIN_BASE_URI/configs?created_time_ms=${initialTime.toEpochMilli()}..${middleTime.toEpochMilli()}",
"$PLUGIN_BASE_URI/configs?created_time_ms=${initialTime.toEpochMilli()}..${middleTime.toEpochMilli() - 1}",
"",
RestStatus.OK.status
)
Expand All @@ -596,7 +596,7 @@ class QueryNotificationConfigIT : PluginRestTestCase() {
// Get notification configs between middleTime..finalTime
val getSecondResponse = executeRequest(
RestRequest.Method.GET.name,
"$PLUGIN_BASE_URI/configs?created_time_ms=${middleTime.toEpochMilli()}..${finalTime.toEpochMilli()}",
"$PLUGIN_BASE_URI/configs?created_time_ms=${middleTime.toEpochMilli()}..${finalTime.toEpochMilli() - 1}",
"",
RestStatus.OK.status
)
Expand All @@ -606,7 +606,7 @@ class QueryNotificationConfigIT : PluginRestTestCase() {
// Get notification configs between finalTime..endTime
val getThirdResponse = executeRequest(
RestRequest.Method.GET.name,
"$PLUGIN_BASE_URI/configs?created_time_ms=${finalTime.toEpochMilli()}..${endTime.toEpochMilli()}",
"$PLUGIN_BASE_URI/configs?created_time_ms=${finalTime.toEpochMilli()}..${endTime.toEpochMilli() - 1}",
"",
RestStatus.OK.status
)
Expand Down

0 comments on commit f33396b

Please sign in to comment.