Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,6 @@ tests:
- class: org.elasticsearch.xpack.inference.external.request.azureopenai.embeddings.AzureOpenAiEmbeddingsRequestTests
method: testCreateRequest_WithEntraIdDefined
issue: https://github.com/elastic/elasticsearch/issues/125061
- class: org.elasticsearch.xpack.ilm.history.ILMHistoryItemTests
method: testTruncateLongError
issue: https://github.com/elastic/elasticsearch/issues/125216
- class: org.elasticsearch.qa.verify_version_constants.VerifyVersionConstantsIT
method: testLuceneVersionConstant
issue: https://github.com/elastic/elasticsearch/issues/125638
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import java.util.Map;

import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.startsWith;

public class ILMHistoryItemTests extends ESTestCase {
Expand Down Expand Up @@ -135,15 +137,15 @@ public void testTruncateLongError() throws IOException {
try (XContentParser p = XContentFactory.xContent(XContentType.JSON).createParser(XContentParserConfiguration.EMPTY, json)) {
Map<String, Object> item = p.map();
assertThat(
item.get("error_details"),
equalTo(
(String) item.get("error_details"),
containsString(
"{\"type\":\"illegal_argument_exception\",\"reason\":\""
// We subtract a number of characters here due to the truncation being based
// on the length of the whole string, not just the "reason" part.
+ longError.substring(0, LifecycleExecutionState.MAXIMUM_STEP_INFO_STRING_LENGTH - 47)
+ "... (5126 chars truncated)\"}"
)
);
assertThat((String) item.get("error_details"), matchesPattern(".*\\.\\.\\. \\(\\d+ chars truncated\\).*"));
}
}
}
Expand Down