Skip to content

Commit 266c803

Browse files
prwhelanrjernst
authored andcommitted
[ML] Randomly generate uuids (elastic#116662)
randomAlpha is generating UTF16 strings, which return as UTF8 and fail to match. Generating random UTF8 strings can generate control characters, which the REST handler throws an error on. So we're generating UUIDs. Fix elastic#113430
1 parent 64b3e33 commit 266c803

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ tests:
112112
- class: org.elasticsearch.xpack.shutdown.NodeShutdownIT
113113
method: testStalledShardMigrationProperlyDetected
114114
issue: https://github.com/elastic/elasticsearch/issues/115697
115-
- class: org.elasticsearch.xpack.inference.InferenceCrudIT
116-
method: testSupportedStream
117-
issue: https://github.com/elastic/elasticsearch/issues/113430
118115
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
119116
method: test {p0=transform/transforms_start_stop/Verify start transform reuses destination index}
120117
issue: https://github.com/elastic/elasticsearch/issues/115808

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceCrudIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public void testUnsupportedStream() throws Exception {
432432
assertEquals(TaskType.SPARSE_EMBEDDING.toString(), singleModel.get("task_type"));
433433

434434
try {
435-
var events = streamInferOnMockService(modelId, TaskType.SPARSE_EMBEDDING, List.of(randomAlphaOfLength(10)));
435+
var events = streamInferOnMockService(modelId, TaskType.SPARSE_EMBEDDING, List.of(randomUUID()));
436436
assertThat(events.size(), equalTo(2));
437437
events.forEach(event -> {
438438
switch (event.name()) {
@@ -457,7 +457,7 @@ public void testSupportedStream() throws Exception {
457457
assertEquals(modelId, singleModel.get("inference_id"));
458458
assertEquals(TaskType.COMPLETION.toString(), singleModel.get("task_type"));
459459

460-
var input = IntStream.range(1, 2 + randomInt(8)).mapToObj(i -> randomAlphaOfLength(10)).toList();
460+
var input = IntStream.range(1, 2 + randomInt(8)).mapToObj(i -> randomUUID()).toList();
461461
try {
462462
var events = streamInferOnMockService(modelId, TaskType.COMPLETION, input);
463463

0 commit comments

Comments
 (0)