File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed 
elasticsearch-api/spec/yaml-test-runner Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 2929password  =  ENV [ 'ELASTIC_PASSWORD' ]  || 'changeme' 
3030uri  =  URI . parse ( host ) 
3131
32+ def  serverless? 
33+   ENV [ 'TEST_SUITE' ]  == 'serverless' 
34+ end 
35+ 
3236if  uri . is_a? ( URI ::HTTPS ) 
3337  raw_certificate  =  File . read ( "#{ CERTS_PATH }  /testnode.crt" ) 
3438  certificate  =  OpenSSL ::X509 ::Certificate . new ( raw_certificate ) 
3539  raw_key  =  File . read ( "#{ CERTS_PATH }  /testnode.key" ) 
3640  key  =  OpenSSL ::PKey ::RSA . new ( raw_key ) 
3741  ca_file  =  File . expand_path ( "#{ CERTS_PATH }  /ca.crt" ) 
38-   host  =  "https://elastic:#{ password }  @#{ uri . host }  :#{ uri . port }  " . freeze  unless  ENV [ 'TEST_SUITE' ]  ==  ' serverless' 
42+   host  =  "https://elastic:#{ password }  @#{ uri . host }  :#{ uri . port }  " . freeze  unless  serverless?  
3943  transport_options  =  { 
4044    ssl : { 
4145      client_cert : certificate , 
4953  transport_options  =  { } 
5054end 
5155
52- options  =  {  host : host ,  transport_options : transport_options ,  compression : true  } 
56+ options  =  { 
57+   host : host , 
58+   transport_options : transport_options , 
59+ } 
5360options . merge! ( {  api_key : ENV [ 'ES_API_KEY' ]  } )  if  ENV [ 'ES_API_KEY' ] 
61+ 
62+ if  serverless? 
63+   options . merge! ( 
64+     { 
65+       retry_on_status : [ 409 ] , 
66+       retry_on_failure : 10 , 
67+       delay_on_retry : 60_000 , 
68+       request_timeout : 120 
69+     } 
70+   ) 
71+ end 
5472CLIENT  =  Elasticsearch ::Client . new ( options ) 
5573
5674tests_path  =  File . expand_path ( './tmp' ,  __dir__ ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments