@@ -68,54 +68,45 @@ context('Create remote detector workflow', () => {
68
68
before ( function ( ) {
69
69
const remoteClusterName = Cypress . env ( 'remoteClusterName' ) ;
70
70
71
- const remoteClusterSettings = {
72
- persistent : {
73
- [ `cluster.remote.${ remoteClusterName } ` ] : {
74
- seeds : [ '127.0.0.1:9301' ] ,
75
- } ,
76
- } ,
77
- } ;
78
-
79
- cy . visit ( AD_URL . OVERVIEW , { timeout : 10000 } ) ;
71
+ const remoteSettings = `${ Cypress . env (
72
+ 'remoteDataSourceNoAuthUrl'
73
+ ) } /_cluster/settings?include_defaults=true`;
80
74
81
75
cy . request ( {
82
- method : 'PUT' ,
83
- url : `${ BACKEND_BASE_PATH } /_cluster/settings` ,
76
+ method : 'GET' ,
77
+ form : false ,
78
+ url : remoteSettings ,
84
79
headers : {
85
- 'content-type' : 'application/json' ,
80
+ 'content-type' : 'application/json;charset=UTF-8 ' ,
86
81
'osd-xsrf' : true ,
87
82
} ,
88
- body : remoteClusterSettings ,
89
83
} ) . then ( ( response ) => {
90
- Cypress . log ( { message : 'Cluster settings updated successfully' } ) ;
91
- expect ( response . status ) . to . eq ( 200 ) ;
92
- } ) ;
84
+ const remoteTransportPort = response . body . defaults . transport . port ;
93
85
94
- cy . wait ( 5000 ) ;
95
- const remoteSettings = `${ Cypress . env (
96
- 'remoteDataSourceNoAuthUrl'
97
- ) } /_cluster/settings?include_defaults=true`;
98
- cy . request (
99
- {
100
- method : 'GET' ,
101
- form : false ,
102
- url : remoteSettings ,
86
+ Cypress . log ( {
87
+ message : `transport port: ${ remoteTransportPort } ` ,
88
+ } ) ;
89
+
90
+ const remoteClusterSettings = {
91
+ persistent : {
92
+ [ `cluster.remote.${ remoteClusterName } ` ] : {
93
+ seeds : [ `127.0.0.1:${ remoteTransportPort } ` ] ,
94
+ } ,
95
+ } ,
96
+ } ;
97
+
98
+ cy . request ( {
99
+ method : 'PUT' ,
100
+ url : `${ BACKEND_BASE_PATH } /_cluster/settings` ,
103
101
headers : {
104
- 'content-type' : 'application/json;charset=UTF-8 ' ,
102
+ 'content-type' : 'application/json' ,
105
103
'osd-xsrf' : true ,
106
104
} ,
107
- } ,
108
- 1000
109
- ) . then ( ( response ) => {
110
- Cypress . log ( {
111
- message : `transport port: ${ JSON . stringify (
112
- response . body . defaults . transport . port
113
- ) } `,
105
+ body : remoteClusterSettings ,
106
+ } ) . then ( ( putResponse ) => {
107
+ Cypress . log ( { message : 'Cluster settings updated successfully' } ) ;
108
+ expect ( putResponse . status ) . to . eq ( 200 ) ;
114
109
} ) ;
115
-
116
- if ( response . body . defaults . transport . port != 9301 ) {
117
- this . skip ( ) ;
118
- }
119
110
} ) ;
120
111
} ) ;
121
112
@@ -144,9 +135,10 @@ context('Create remote detector workflow', () => {
144
135
} ,
145
136
body : data ,
146
137
} ,
147
- 1000
138
+ 2000
148
139
) ;
149
140
} ) ;
141
+ cy . wait ( 1000 ) ;
150
142
cy . fixture ( AD_FIXTURE_BASE_PATH + 'sample_remote_test_data.txt' ) . then (
151
143
( data ) => {
152
144
cy . request (
0 commit comments