Skip to content

Commit 50a33c6

Browse files
[ML][TEST] Use java 11 valid time format in DataDescriptionTests (#31817)
It seems that java 11 tightened some validations with regard to time formats. The random instance creator was setting an odd time format to the data description which is invalid when run with java 11. This commit changes it to a valid format.
1 parent c1e1bce commit 50a33c6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/job/config/DataDescriptionTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.common.xcontent.XContentParser;
1515
import org.elasticsearch.common.xcontent.json.JsonXContent;
1616
import org.elasticsearch.test.AbstractSerializingTestCase;
17-
import org.elasticsearch.xpack.core.ml.job.config.DataDescription;
1817
import org.elasticsearch.xpack.core.ml.job.config.DataDescription.DataFormat;
1918
import org.elasticsearch.xpack.core.ml.job.messages.Messages;
2019

@@ -255,7 +254,7 @@ protected DataDescription createTestInstance() {
255254
} else if (randomBoolean()) {
256255
format = DataDescription.EPOCH_MS;
257256
} else {
258-
format = "yyy.MM.dd G 'at' HH:mm:ss z";
257+
format = "yyyy-MM-dd HH:mm:ss.SSS";
259258
}
260259
dataDescription.setTimeFormat(format);
261260
}

0 commit comments

Comments
 (0)