Skip to content

Commit

Permalink
[ML] Randomly generate uuids (elastic#116662)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
prwhelan authored Nov 20, 2024
1 parent dcd7fb7 commit 0e64179
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ tests:
- class: org.elasticsearch.xpack.shutdown.NodeShutdownIT
method: testStalledShardMigrationProperlyDetected
issue: https://github.com/elastic/elasticsearch/issues/115697
- class: org.elasticsearch.xpack.inference.InferenceCrudIT
method: testSupportedStream
issue: https://github.com/elastic/elasticsearch/issues/113430
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
method: test {p0=transform/transforms_start_stop/Verify start transform reuses destination index}
issue: https://github.com/elastic/elasticsearch/issues/115808
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public void testUnsupportedStream() throws Exception {
assertEquals(TaskType.SPARSE_EMBEDDING.toString(), singleModel.get("task_type"));

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

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

Expand Down

0 comments on commit 0e64179

Please sign in to comment.