From 1c9b97d4e462dcab66a2f4be413a093c489f263d Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Wed, 10 Sep 2025 11:25:13 +0200 Subject: [PATCH 1/2] Run Loki integration test in past --- .../test/java/io/trino/plugin/loki/TestLokiIntegration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java b/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java index b64ab89a6aea..05ee3bde9916 100644 --- a/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java +++ b/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java @@ -154,8 +154,8 @@ void testLabelsComplex() void testSelectTimestampLogsQuery() throws Exception { - Instant start = Instant.now().truncatedTo(ChronoUnit.HOURS); - Instant end = start.plus(Duration.ofHours(1)); + Instant start = Instant.now().truncatedTo(ChronoUnit.HOURS).minus(Duration.ofHours(4)); + Instant end = start.plus(Duration.ofHours(3)); Instant firstLineTimestamp = start.plus(Duration.ofMinutes(5)).truncatedTo(ChronoUnit.SECONDS); client.pushLogLine("line 1", firstLineTimestamp, ImmutableMap.of("test", "select_timestamp_query")); From 10dc385570e863d43f72fc6991c3055d596921e1 Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Thu, 11 Sep 2025 10:45:12 +0900 Subject: [PATCH 2/2] Fix format of TestLokiIntegration --- .../plugin/loki/TestLokiIntegration.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java b/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java index 05ee3bde9916..a7aaa6236cfb 100644 --- a/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java +++ b/plugin/trino-loki/src/test/java/io/trino/plugin/loki/TestLokiIntegration.java @@ -213,27 +213,27 @@ void testQueryRangeInvalidArguments() { assertQueryFails( """ - SELECT to_iso8601(timestamp), value FROM - TABLE(system.query_range( - 'count_over_time({test="timestamp_metrics_query"}[5m])', - TIMESTAMP '2012-08-08', - TIMESTAMP '2012-08-09', - -300 - )) - LIMIT 1 - """, + SELECT to_iso8601(timestamp), value FROM + TABLE(system.query_range( + 'count_over_time({test="timestamp_metrics_query"}[5m])', + TIMESTAMP '2012-08-08', + TIMESTAMP '2012-08-09', + -300 + )) + LIMIT 1 + """, "step must be positive"); assertQueryFails( """ - SELECT to_iso8601(timestamp), value FROM - TABLE(system.query_range( - 'count_over_time({test="timestamp_metrics_query"}[5m])', - TIMESTAMP '2012-08-08', - TIMESTAMP '2012-08-09', - NULL - )) - LIMIT 1 - """, + SELECT to_iso8601(timestamp), value FROM + TABLE(system.query_range( + 'count_over_time({test="timestamp_metrics_query"}[5m])', + TIMESTAMP '2012-08-08', + TIMESTAMP '2012-08-09', + NULL + )) + LIMIT 1 + """, "step must be positive"); } }