Skip to content

Commit 9552497

Browse files
committed
Fix flaky test related to irregular number in some locales in datetime IT
Signed-off-by: Yuanchun Shen <[email protected]>
1 parent 775d504 commit 9552497

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

integ-test/src/test/java/org/opensearch/sql/calcite/standalone/CalcitePPLDateTimeBuiltinFunctionIT.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,14 @@ public void testWeekAndWeekOfYearWithFilter() {
439439
JSONObject actual =
440440
executeQuery(
441441
String.format(
442+
Locale.ROOT,
442443
"source=%s | fields strict_date_optional_time"
443444
+ "| where YEAR(strict_date_optional_time) < 2000"
444445
+ "| where WEEK(DATE(strict_date_optional_time)) = %d"
445446
+ "| stats COUNT() AS CNT "
446447
+ "| head 1 ",
447-
TEST_INDEX_DATE_FORMATS, week19840412));
448+
TEST_INDEX_DATE_FORMATS,
449+
week19840412));
448450

449451
verifySchema(actual, schema("CNT", "bigint"));
450452

@@ -1039,8 +1041,8 @@ public void testDateFormatAndDatetimeAndFromDays() throws IOException {
10391041
"2017-11-02",
10401042
expectedDatetimeAtPlus8,
10411043
expectedDatetimeAtUTC,
1042-
String.format("%d 1984 %d", week19840412, week19840412),
1043-
String.format("%d %d 1984", week19840412Mode1, week19840412Mode1),
1044+
String.format(Locale.ROOT, "%d 1984 %d", week19840412, week19840412),
1045+
String.format(Locale.ROOT, "%d %d 1984", week19840412Mode1, week19840412Mode1),
10441046
"09:07:42.000123"));
10451047
}
10461048

0 commit comments

Comments
 (0)