This repository was archived by the owner on Sep 21, 2021. It is now read-only.
File tree 2 files changed +20
-0
lines changed
src/main/java/de/zalando/ep/zalenium/container/swarm
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ Make sure passing the network name with its stack name as prefix.
90
90
In our example we named our network "zalenium" and the stack was named "STACK" so the network
91
91
will have the name ` "STACK_zalenium" ` , which we passed to ` "--swarmOverlayNetwork" ` .
92
92
93
+ #### Options
94
+
95
+ If you want browser containers only deployed on workers set ` SWARM_RUN_TESTS_ONLY_ON_WORKERS=1 `
96
+ as environment variable.
93
97
94
98
### Technical Information
95
99
@@ -111,5 +115,14 @@ will happen that docker will remove a browser container with a running test to f
111
115
number of replicas.
112
116
113
117
118
+ ### Known Errors
119
+
120
+ Executed tests run into following forwarding errors:
121
+ - ` was terminated due to FORWARDING_TO_NODE_FAILED `
122
+ - ` cannot forward the request unexpected end of stream on Connection `
123
+ The docker swarm seems to be overloaded. Try to reduce ` --maxDockerSeleniumContainers ` to unload
124
+ your docker swarm system. A good value is the number of all cpu cores available in the docker swarm.
125
+
126
+
114
127
115
128
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public class SwarmContainerClient implements ContainerClient {
32
32
33
33
private static final String ZALENIUM_SELENIUM_CONTAINER_CPU_LIMIT = "ZALENIUM_SELENIUM_CONTAINER_CPU_LIMIT" ;
34
34
private static final String ZALENIUM_SELENIUM_CONTAINER_MEMORY_LIMIT = "ZALENIUM_SELENIUM_CONTAINER_MEMORY_LIMIT" ;
35
+ private static final String SWARM_RUN_TESTS_ONLY_ON_WORKERS = "SWARM_RUN_TESTS_ONLY_ON_WORKERS" ;
35
36
36
37
private static final String SWARM_EXEC_IMAGE = "datagridsys/skopos-plugin-swarm-exec:latest" ;
37
38
@@ -270,6 +271,12 @@ private TaskSpec buildTaskSpec(ContainerSpec containerSpec) {
270
271
.restartPolicy (restartPolicy )
271
272
.containerSpec (containerSpec );
272
273
274
+ if ("1" .equals (env .getEnvVariable (SWARM_RUN_TESTS_ONLY_ON_WORKERS ))) {
275
+ final List <String > placementList = new ArrayList <>();
276
+ placementList .add ("node.role==worker" );
277
+ taskSpecBuilder .placement (Placement .create (placementList ));
278
+ }
279
+
273
280
return taskSpecBuilder .build ();
274
281
}
275
282
You can’t perform that action at this time.
0 commit comments