From 1a69cedf35970f3f84d86e5a42066d6a70ac0edb Mon Sep 17 00:00:00 2001 From: Rishabh Maurya Date: Tue, 8 Nov 2022 15:18:23 -0800 Subject: [PATCH] Fix time bounds in query to address indeterminism (#566) * 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) --- .../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 )