File tree 2 files changed +5
-6
lines changed
x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/history
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -468,9 +468,6 @@ tests:
468
468
- class : org.elasticsearch.xpack.inference.external.request.azureopenai.embeddings.AzureOpenAiEmbeddingsRequestTests
469
469
method : testCreateRequest_WithEntraIdDefined
470
470
issue : https://github.com/elastic/elasticsearch/issues/125061
471
- - class : org.elasticsearch.xpack.ilm.history.ILMHistoryItemTests
472
- method : testTruncateLongError
473
- issue : https://github.com/elastic/elasticsearch/issues/125216
474
471
- class : org.elasticsearch.qa.verify_version_constants.VerifyVersionConstantsIT
475
472
method : testLuceneVersionConstant
476
473
issue : https://github.com/elastic/elasticsearch/issues/125638
Original file line number Diff line number Diff line change 22
22
import java .util .Map ;
23
23
24
24
import static org .elasticsearch .xcontent .XContentFactory .jsonBuilder ;
25
+ import static org .hamcrest .Matchers .containsString ;
25
26
import static org .hamcrest .Matchers .equalTo ;
27
+ import static org .hamcrest .Matchers .matchesPattern ;
26
28
import static org .hamcrest .Matchers .startsWith ;
27
29
28
30
public class ILMHistoryItemTests extends ESTestCase {
@@ -135,15 +137,15 @@ public void testTruncateLongError() throws IOException {
135
137
try (XContentParser p = XContentFactory .xContent (XContentType .JSON ).createParser (XContentParserConfiguration .EMPTY , json )) {
136
138
Map <String , Object > item = p .map ();
137
139
assertThat (
138
- item .get ("error_details" ),
139
- equalTo (
140
+ ( String ) item .get ("error_details" ),
141
+ containsString (
140
142
"{\" type\" :\" illegal_argument_exception\" ,\" reason\" :\" "
141
143
// We subtract a number of characters here due to the truncation being based
142
144
// on the length of the whole string, not just the "reason" part.
143
145
+ longError .substring (0 , LifecycleExecutionState .MAXIMUM_STEP_INFO_STRING_LENGTH - 47 )
144
- + "... (5126 chars truncated)\" }"
145
146
)
146
147
);
148
+ assertThat ((String ) item .get ("error_details" ), matchesPattern (".*\\ .\\ .\\ . \\ (\\ d+ chars truncated\\ ).*" ));
147
149
}
148
150
}
149
151
}
You can’t perform that action at this time.
0 commit comments