Skip to content

Commit

Permalink
Fix time bounds in query to address indeterminism (#566)
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 <[email protected]>

Signed-off-by: Rishabh Maurya <[email protected]>
  • Loading branch information
rishabhmaurya authored Nov 8, 2022
1 parent f1eb8cb commit 63e5f13
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 63e5f13

Please sign in to comment.