Skip to content

Commit ea2772c

Browse files
committed
Adjusted tests for portIncrement of 10
1 parent a1e3519 commit ea2772c

10 files changed

+94
-93
lines changed

test/docker_cluster_default_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func TestDockerClusterDefault(t *testing.T) {
8787
"--label starter-test=true",
8888
"--name=" + cID2,
8989
"--rm",
90-
fmt.Sprintf("-p %d:%d", basePort+5, basePort),
90+
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
9191
fmt.Sprintf("-v %s:/data", volID2),
9292
"-v /var/run/docker.sock:/var/run/docker.sock",
9393
"arangodb/arangodb-starter",
@@ -105,7 +105,7 @@ func TestDockerClusterDefault(t *testing.T) {
105105
"--label starter-test=true",
106106
"--name=" + cID3,
107107
"--rm",
108-
fmt.Sprintf("-p %d:%d", basePort+10, basePort),
108+
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
109109
fmt.Sprintf("-v %s:/data", volID3),
110110
"-v /var/run/docker.sock:/var/run/docker.sock",
111111
"arangodb/arangodb-starter",
@@ -119,17 +119,17 @@ func TestDockerClusterDefault(t *testing.T) {
119119

120120
if ok := WaitUntilStarterReady(t, whatCluster, dockerRun1, dockerRun2, dockerRun3); ok {
121121
t.Logf("Cluster start took %s", time.Since(start))
122-
testCluster(t, insecureStarterEndpoint(0), false)
123-
testCluster(t, insecureStarterEndpoint(5), false)
124-
testCluster(t, insecureStarterEndpoint(10), false)
122+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
123+
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
124+
testCluster(t, insecureStarterEndpoint(2*portIncrement), false)
125125
}
126126

127127
if isVerbose {
128128
t.Log("Waiting for termination")
129129
}
130-
ShutdownStarter(t, insecureStarterEndpoint(0))
131-
ShutdownStarter(t, insecureStarterEndpoint(5))
132-
ShutdownStarter(t, insecureStarterEndpoint(10))
130+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
131+
ShutdownStarter(t, insecureStarterEndpoint(1*portIncrement))
132+
ShutdownStarter(t, insecureStarterEndpoint(2*portIncrement))
133133
}
134134

135135
// TestOldDockerClusterDefault runs 3 arangodb starters in docker with default settings.
@@ -189,7 +189,7 @@ func TestOldDockerClusterDefault(t *testing.T) {
189189
"--label starter-test=true",
190190
"--name=" + cID2,
191191
"--rm",
192-
fmt.Sprintf("-p %d:%d", basePort+5, basePort),
192+
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
193193
fmt.Sprintf("-v %s:/data", volID2),
194194
"-v /var/run/docker.sock:/var/run/docker.sock",
195195
"arangodb/arangodb-starter",
@@ -207,7 +207,7 @@ func TestOldDockerClusterDefault(t *testing.T) {
207207
"--label starter-test=true",
208208
"--name=" + cID3,
209209
"--rm",
210-
fmt.Sprintf("-p %d:%d", basePort+10, basePort),
210+
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
211211
fmt.Sprintf("-v %s:/data", volID3),
212212
"-v /var/run/docker.sock:/var/run/docker.sock",
213213
"arangodb/arangodb-starter",
@@ -221,15 +221,15 @@ func TestOldDockerClusterDefault(t *testing.T) {
221221

222222
if ok := WaitUntilStarterReady(t, whatCluster, dockerRun1, dockerRun2, dockerRun3); ok {
223223
t.Logf("Cluster start took %s", time.Since(start))
224-
testCluster(t, insecureStarterEndpoint(0), false)
225-
testCluster(t, insecureStarterEndpoint(5), false)
226-
testCluster(t, insecureStarterEndpoint(10), false)
224+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
225+
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
226+
testCluster(t, insecureStarterEndpoint(2*portIncrement), false)
227227
}
228228

229229
if isVerbose {
230230
t.Log("Waiting for termination")
231231
}
232-
ShutdownStarter(t, insecureStarterEndpoint(0))
233-
ShutdownStarter(t, insecureStarterEndpoint(5))
234-
ShutdownStarter(t, insecureStarterEndpoint(10))
232+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
233+
ShutdownStarter(t, insecureStarterEndpoint(1*portIncrement))
234+
ShutdownStarter(t, insecureStarterEndpoint(2*portIncrement))
235235
}

test/docker_cluster_local_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ func TestDockerClusterLocal(t *testing.T) {
7777

7878
if ok := WaitUntilStarterReady(t, whatCluster, dockerRun); ok {
7979
t.Logf("Cluster start took %s", time.Since(start))
80-
testCluster(t, insecureStarterEndpoint(0), false)
80+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
8181
}
8282

8383
if isVerbose {
8484
t.Log("Waiting for termination")
8585
}
86-
ShutdownStarter(t, insecureStarterEndpoint(0))
86+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
8787
}
8888

8989
// TestDockerClusterLocalAgencySize1 runs the arangodb starter in docker
@@ -136,13 +136,13 @@ func TestDockerClusterLocalAgencySize1(t *testing.T) {
136136

137137
if ok := WaitUntilStarterReady(t, whatCluster, dockerRun); ok {
138138
t.Logf("Cluster start took %s", time.Since(start))
139-
testCluster(t, insecureStarterEndpoint(0), false)
139+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
140140
}
141141

142142
if isVerbose {
143143
t.Log("Waiting for termination")
144144
}
145-
ShutdownStarter(t, insecureStarterEndpoint(0))
145+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
146146
}
147147

148148
// TestOldDockerClusterLocal runs the arangodb starter in docker with `--local`
@@ -191,11 +191,11 @@ func TestOldDockerClusterLocal(t *testing.T) {
191191

192192
if ok := WaitUntilStarterReady(t, whatCluster, dockerRun); ok {
193193
t.Logf("Cluster start took %s", time.Since(start))
194-
testCluster(t, insecureStarterEndpoint(0), false)
194+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
195195
}
196196

197197
if isVerbose {
198198
t.Log("Waiting for termination")
199199
}
200-
ShutdownStarter(t, insecureStarterEndpoint(0))
200+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
201201
}

test/docker_resilientsingle_default_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func TestDockerResilientSingleDefault(t *testing.T) {
9090
"--label starter-test=true",
9191
"--name=" + cID2,
9292
"--rm",
93-
fmt.Sprintf("-p %d:%d", basePort+5, basePort),
93+
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
9494
fmt.Sprintf("-v %s:/data", volID2),
9595
"-v /var/run/docker.sock:/var/run/docker.sock",
9696
"arangodb/arangodb-starter",
@@ -109,7 +109,7 @@ func TestDockerResilientSingleDefault(t *testing.T) {
109109
"--label starter-test=true",
110110
"--name=" + cID3,
111111
"--rm",
112-
fmt.Sprintf("-p %d:%d", basePort+10, basePort),
112+
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
113113
fmt.Sprintf("-v %s:/data", volID3),
114114
"-v /var/run/docker.sock:/var/run/docker.sock",
115115
"arangodb/arangodb-starter",
@@ -124,17 +124,17 @@ func TestDockerResilientSingleDefault(t *testing.T) {
124124

125125
if ok := WaitUntilStarterReady(t, whatResilientSingle, dockerRun1, dockerRun2, dockerRun3); ok {
126126
t.Logf("ResilientSingle start took %s", time.Since(start))
127-
testResilientSingle(t, insecureStarterEndpoint(0), false, false)
128-
testResilientSingle(t, insecureStarterEndpoint(5), false, false)
129-
testResilientSingle(t, insecureStarterEndpoint(10), false, false)
127+
testResilientSingle(t, insecureStarterEndpoint(0*portIncrement), false, false)
128+
testResilientSingle(t, insecureStarterEndpoint(1*portIncrement), false, false)
129+
testResilientSingle(t, insecureStarterEndpoint(2*portIncrement), false, false)
130130
}
131131

132132
if isVerbose {
133133
t.Log("Waiting for termination")
134134
}
135-
ShutdownStarter(t, insecureStarterEndpoint(0))
136-
ShutdownStarter(t, insecureStarterEndpoint(5))
137-
ShutdownStarter(t, insecureStarterEndpoint(10))
135+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
136+
ShutdownStarter(t, insecureStarterEndpoint(1*portIncrement))
137+
ShutdownStarter(t, insecureStarterEndpoint(2*portIncrement))
138138
}
139139

140140
// TestDockerResilientSingle2Instance runs 3 arangodb starters in docker with mode=resilientsingle
@@ -197,7 +197,7 @@ func TestDockerResilientSingle2Instance(t *testing.T) {
197197
"--label starter-test=true",
198198
"--name=" + cID2,
199199
"--rm",
200-
fmt.Sprintf("-p %d:%d", basePort+5, basePort),
200+
fmt.Sprintf("-p %d:%d", basePort+(1*portIncrement), basePort),
201201
fmt.Sprintf("-v %s:/data", volID2),
202202
"-v /var/run/docker.sock:/var/run/docker.sock",
203203
"arangodb/arangodb-starter",
@@ -216,7 +216,7 @@ func TestDockerResilientSingle2Instance(t *testing.T) {
216216
"--label starter-test=true",
217217
"--name=" + cID3,
218218
"--rm",
219-
fmt.Sprintf("-p %d:%d", basePort+10, basePort),
219+
fmt.Sprintf("-p %d:%d", basePort+(2*portIncrement), basePort),
220220
fmt.Sprintf("-v %s:/data", volID3),
221221
"-v /var/run/docker.sock:/var/run/docker.sock",
222222
"arangodb/arangodb-starter",
@@ -232,15 +232,15 @@ func TestDockerResilientSingle2Instance(t *testing.T) {
232232

233233
if ok := WaitUntilStarterReady(t, whatResilientSingle, dockerRun1, dockerRun2 /*not docker3*/); ok {
234234
t.Logf("ResilientSingle start took %s", time.Since(start))
235-
testResilientSingle(t, insecureStarterEndpoint(0), false, false)
236-
testResilientSingle(t, insecureStarterEndpoint(5), false, false)
237-
testResilientSingle(t, insecureStarterEndpoint(10), false, true)
235+
testResilientSingle(t, insecureStarterEndpoint(0*portIncrement), false, false)
236+
testResilientSingle(t, insecureStarterEndpoint(1*portIncrement), false, false)
237+
testResilientSingle(t, insecureStarterEndpoint(2*portIncrement), false, true)
238238
}
239239

240240
if isVerbose {
241241
t.Log("Waiting for termination")
242242
}
243-
ShutdownStarter(t, insecureStarterEndpoint(0))
244-
ShutdownStarter(t, insecureStarterEndpoint(5))
245-
ShutdownStarter(t, insecureStarterEndpoint(10))
243+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
244+
ShutdownStarter(t, insecureStarterEndpoint(1*portIncrement))
245+
ShutdownStarter(t, insecureStarterEndpoint(2*portIncrement))
246246
}

test/docker_resilientsingle_local_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ func TestDockerResilientSingleLocal(t *testing.T) {
7979

8080
if ok := WaitUntilStarterReady(t, whatResilientSingle, dockerRun); ok {
8181
t.Logf("ResilientSingle start took %s", time.Since(start))
82-
testResilientSingle(t, insecureStarterEndpoint(0), false, false)
82+
testResilientSingle(t, insecureStarterEndpoint(0*portIncrement), false, false)
8383
}
8484

8585
if isVerbose {
8686
t.Log("Waiting for termination")
8787
}
88-
ShutdownStarter(t, insecureStarterEndpoint(0))
88+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
8989
}
9090

9191
// TestDockerResilientSingleLocalSecure runs the arangodb starter in docker with mode `resilientsingle`,
@@ -139,11 +139,11 @@ func TestDockerResilientSingleLocalSecure(t *testing.T) {
139139

140140
if ok := WaitUntilStarterReady(t, whatResilientSingle, dockerRun); ok {
141141
t.Logf("ResilientSingle start took %s", time.Since(start))
142-
testResilientSingle(t, secureStarterEndpoint(0), true, false)
142+
testResilientSingle(t, secureStarterEndpoint(0*portIncrement), true, false)
143143
}
144144

145145
if isVerbose {
146146
t.Log("Waiting for termination")
147147
}
148-
ShutdownStarter(t, secureStarterEndpoint(0))
148+
ShutdownStarter(t, secureStarterEndpoint(0*portIncrement))
149149
}

test/docker_single_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ func TestDockerSingle(t *testing.T) {
7777

7878
if ok := WaitUntilStarterReady(t, whatSingle, dockerRun); ok {
7979
t.Logf("Single server start took %s", time.Since(start))
80-
testSingle(t, insecureStarterEndpoint(0), false)
80+
testSingle(t, insecureStarterEndpoint(0*portIncrement), false)
8181
}
8282

8383
if isVerbose {
8484
t.Log("Waiting for termination")
8585
}
86-
ShutdownStarter(t, insecureStarterEndpoint(0))
86+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
8787
}
8888

8989
// TestDockerSingleAutoKeyFile runs the arangodb starter in docker with `--starter.mode=single` && `--ssl.auto-key`
@@ -135,13 +135,13 @@ func TestDockerSingleAutoKeyFile(t *testing.T) {
135135

136136
if ok := WaitUntilStarterReady(t, whatSingle, dockerRun); ok {
137137
t.Logf("Single server start took %s", time.Since(start))
138-
testSingle(t, secureStarterEndpoint(0), true)
138+
testSingle(t, secureStarterEndpoint(0*portIncrement), true)
139139
}
140140

141141
if isVerbose {
142142
t.Log("Waiting for termination")
143143
}
144-
ShutdownStarter(t, secureStarterEndpoint(0))
144+
ShutdownStarter(t, secureStarterEndpoint(0*portIncrement))
145145
}
146146

147147
// TestDockerSingleAutoContainerName runs the arangodb starter in docker with `--starter.mode=single` automatic detection of its container name.
@@ -189,13 +189,13 @@ func TestDockerSingleAutoContainerName(t *testing.T) {
189189

190190
if ok := WaitUntilStarterReady(t, whatSingle, dockerRun); ok {
191191
t.Logf("Single server start took %s", time.Since(start))
192-
testSingle(t, insecureStarterEndpoint(0), false)
192+
testSingle(t, insecureStarterEndpoint(0*portIncrement), false)
193193
}
194194

195195
if isVerbose {
196196
t.Log("Waiting for termination")
197197
}
198-
ShutdownStarter(t, insecureStarterEndpoint(0))
198+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
199199
}
200200

201201
// TestDockerSingleAutoRocksdb runs the arangodb starter in docker with `--server.storage-engine=rocksdb` and a 3.2 image.
@@ -248,13 +248,13 @@ func TestDockerSingleAutoRocksdb(t *testing.T) {
248248

249249
if ok := WaitUntilStarterReady(t, whatSingle, dockerRun); ok {
250250
t.Logf("Single server start took %s", time.Since(start))
251-
testSingle(t, insecureStarterEndpoint(0), false)
251+
testSingle(t, insecureStarterEndpoint(0*portIncrement), false)
252252
}
253253

254254
if isVerbose {
255255
t.Log("Waiting for termination")
256256
}
257-
ShutdownStarter(t, insecureStarterEndpoint(0))
257+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
258258
}
259259

260260
// TestOldDockerSingleAutoKeyFile runs the arangodb starter in docker with `--mode=single` && `--sslAutoKeyFile`
@@ -304,11 +304,11 @@ func TestOldDockerSingleAutoKeyFile(t *testing.T) {
304304

305305
if ok := WaitUntilStarterReady(t, whatSingle, dockerRun); ok {
306306
t.Logf("Single server start took %s", time.Since(start))
307-
testSingle(t, secureStarterEndpoint(0), true)
307+
testSingle(t, secureStarterEndpoint(0*portIncrement), true)
308308
}
309309

310310
if isVerbose {
311311
t.Log("Waiting for termination")
312312
}
313-
ShutdownStarter(t, secureStarterEndpoint(0))
313+
ShutdownStarter(t, secureStarterEndpoint(0*portIncrement))
314314
}

test/process_cluster_default_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ func TestProcessClusterDefault(t *testing.T) {
5353

5454
if ok := WaitUntilStarterReady(t, whatCluster, master, slave1, slave2); ok {
5555
t.Logf("Cluster start took %s", time.Since(start))
56-
testCluster(t, insecureStarterEndpoint(0), false)
57-
testCluster(t, insecureStarterEndpoint(5), false)
58-
testCluster(t, insecureStarterEndpoint(10), false)
56+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
57+
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
58+
testCluster(t, insecureStarterEndpoint(2*portIncrement), false)
5959
}
6060

6161
if isVerbose {
@@ -89,17 +89,17 @@ func TestProcessClusterDefaultShutdownViaAPI(t *testing.T) {
8989

9090
if ok := WaitUntilStarterReady(t, whatCluster, master, slave1, slave2); ok {
9191
t.Logf("Cluster start took %s", time.Since(start))
92-
testCluster(t, insecureStarterEndpoint(0), false)
93-
testCluster(t, insecureStarterEndpoint(5), false)
94-
testCluster(t, insecureStarterEndpoint(10), false)
92+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
93+
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
94+
testCluster(t, insecureStarterEndpoint(2*portIncrement), false)
9595
}
9696

9797
if isVerbose {
9898
t.Log("Waiting for termination")
9999
}
100-
ShutdownStarter(t, insecureStarterEndpoint(0))
101-
ShutdownStarter(t, insecureStarterEndpoint(5))
102-
ShutdownStarter(t, insecureStarterEndpoint(10))
100+
ShutdownStarter(t, insecureStarterEndpoint(0*portIncrement))
101+
ShutdownStarter(t, insecureStarterEndpoint(1*portIncrement))
102+
ShutdownStarter(t, insecureStarterEndpoint(2*portIncrement))
103103
}
104104

105105
// TestOldProcessClusterDefault starts a master starter, followed by 2 slave starters.
@@ -127,9 +127,9 @@ func TestOldProcessClusterDefault(t *testing.T) {
127127

128128
if ok := WaitUntilStarterReady(t, whatCluster, master, slave1, slave2); ok {
129129
t.Logf("Cluster start took %s", time.Since(start))
130-
testCluster(t, insecureStarterEndpoint(0), false)
131-
testCluster(t, insecureStarterEndpoint(5), false)
132-
testCluster(t, insecureStarterEndpoint(10), false)
130+
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
131+
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
132+
testCluster(t, insecureStarterEndpoint(2*portIncrement), false)
133133
}
134134

135135
if isVerbose {

0 commit comments

Comments
 (0)