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 29
29
password = ENV [ 'ELASTIC_PASSWORD' ] || 'changeme'
30
30
uri = URI . parse ( host )
31
31
32
+ def serverless?
33
+ ENV [ 'TEST_SUITE' ] == 'serverless'
34
+ end
35
+
32
36
if uri . is_a? ( URI ::HTTPS )
33
37
raw_certificate = File . read ( "#{ CERTS_PATH } /testnode.crt" )
34
38
certificate = OpenSSL ::X509 ::Certificate . new ( raw_certificate )
35
39
raw_key = File . read ( "#{ CERTS_PATH } /testnode.key" )
36
40
key = OpenSSL ::PKey ::RSA . new ( raw_key )
37
41
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?
39
43
transport_options = {
40
44
ssl : {
41
45
client_cert : certificate ,
49
53
transport_options = { }
50
54
end
51
55
52
- options = { host : host , transport_options : transport_options , compression : true }
56
+ options = {
57
+ host : host ,
58
+ transport_options : transport_options ,
59
+ }
53
60
options . 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
54
72
CLIENT = Elasticsearch ::Client . new ( options )
55
73
56
74
tests_path = File . expand_path ( './tmp' , __dir__ )
You can’t perform that action at this time.
0 commit comments