From c523abd9c3a8ef6be1730df8ec97e25119019348 Mon Sep 17 00:00:00 2001 From: Rishabh Maurya Date: Tue, 8 Nov 2022 12:27:46 -0800 Subject: [PATCH] Fix time bounds in query to address indeterminism * 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 --- .../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 )