99
1010package org .elasticsearch ;
1111
12+ import com .carrotsearch .randomizedtesting .annotations .Seed ;
1213import org .apache .lucene .util .Constants ;
1314import org .elasticsearch .action .NoShardAvailableActionException ;
1415import org .elasticsearch .action .RoutingMissingException ;
@@ -1188,6 +1189,7 @@ public void testFailureToAndFromXContentWithNoDetailsV8() throws IOException {
11881189 assertNull (parsedFailure .getCause ());
11891190 }
11901191
1192+
11911193 public void testFailureToAndFromXContentWithDetails () throws IOException {
11921194 final XContent xContent = randomFrom (XContentType .values ()).xContent ();
11931195
@@ -1258,6 +1260,7 @@ public void testFailureToAndFromXContentWithDetails() throws IOException {
12581260 DiscoveryNode node = DiscoveryNodeUtils .create ("node_g" );
12591261 failureCause = new NodeClosedException (node );
12601262 failureCause = new NoShardAvailableActionException (new ShardId ("_index_g" , "_uuid_g" , 6 ), "node_g" , failureCause );
1263+ String sessionId = UUIDs .randomBase64UUID ();
12611264 ShardSearchFailure [] shardFailures = new ShardSearchFailure [] {
12621265 new ShardSearchFailure (
12631266 new ParsingException (0 , 0 , "Parsing g" , null ),
@@ -1268,7 +1271,7 @@ public void testFailureToAndFromXContentWithDetails() throws IOException {
12681271 new SearchShardTarget ("node_g" , new ShardId (new Index ("_index_g" , "_uuid_g" ), 62 ), null )
12691272 ),
12701273 new ShardSearchFailure (
1271- new SearchContextMissingException (new ShardSearchContextId (UUIDs . randomBase64UUID () , 0L )),
1274+ new SearchContextMissingException (new ShardSearchContextId (sessionId , 0L )),
12721275 null
12731276 ) };
12741277 failure = new SearchPhaseExecutionException ("phase_g" , "G" , failureCause , shardFailures );
@@ -1293,7 +1296,10 @@ public void testFailureToAndFromXContentWithDetails() throws IOException {
12931296 );
12941297 expected .addSuppressed (
12951298 new ElasticsearchException (
1296- "Elasticsearch exception [type=search_context_missing_exception, " + "reason=No search context found for id [0]]"
1299+ "Elasticsearch exception [type=search_context_missing_exception, "
1300+ + "reason=No search context found for id ["
1301+ + sessionId
1302+ + "/0]]"
12971303 )
12981304 );
12991305 }
0 commit comments