From f33396b2a87b3534b9a8c1ae2c8b88516b3e6fb9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 10:11:10 -0800 Subject: [PATCH] Fix time bounds in query to address indeterminism (#566) (#568) * 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 Signed-off-by: Rishabh Maurya (cherry picked from commit 63e5f13792c33cb50780c6f8f15c3fea74bf65dd) Co-authored-by: Rishabh Maurya --- .../integtest/config/QueryNotificationConfigIT.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/QueryNotificationConfigIT.kt b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/QueryNotificationConfigIT.kt index 48720824..a7937f88 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/QueryNotificationConfigIT.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/QueryNotificationConfigIT.kt @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 ) @@ -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 )