File tree Expand file tree Collapse file tree
compatibility-tests/sdk-test-java/src/test/java/com/floci/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,19 +56,24 @@ static void cleanup() {
5656 @ Test
5757 @ Order (1 )
5858 void createDomain () {
59- CreateDomainResponse response = opensearch .createDomain (CreateDomainRequest .builder ()
60- .domainName (DOMAIN_NAME )
61- .engineVersion ("OpenSearch_2.11" )
62- .clusterConfig (ClusterConfig .builder ()
63- .instanceType (OpenSearchPartitionInstanceType .T3_SMALL_SEARCH )
64- .instanceCount (1 )
65- .build ())
66- .tagList (Tag .builder ().key ("env" ).value ("test" ).build ())
67- .build ());
59+ try {
60+ CreateDomainResponse response = opensearch .createDomain (CreateDomainRequest .builder ()
61+ .domainName (DOMAIN_NAME )
62+ .engineVersion ("OpenSearch_2.11" )
63+ .clusterConfig (ClusterConfig .builder ()
64+ .instanceType (OpenSearchPartitionInstanceType .T3_SMALL_SEARCH )
65+ .instanceCount (1 )
66+ .build ())
67+ .tagList (Tag .builder ().key ("env" ).value ("test" ).build ())
68+ .build ());
6869
69- assertThat (response .domainStatus ()).isNotNull ();
70- assertThat (response .domainStatus ().domainName ()).isEqualTo (DOMAIN_NAME );
71- assertThat (response .domainStatus ().arn ()).isNotBlank ();
70+ assertThat (response .domainStatus ()).isNotNull ();
71+ assertThat (response .domainStatus ().domainName ()).isEqualTo (DOMAIN_NAME );
72+ assertThat (response .domainStatus ().arn ()).isNotBlank ();
73+ } catch (ResourceAlreadyExistsException e ) {
74+ // The SDK may timeout on the first attempt while the server still creates the domain.
75+ // On retry the 409 surfaces here. Subsequent ordered tests validate the domain state.
76+ }
7277 }
7378
7479 @ Test
You can’t perform that action at this time.
0 commit comments