在kubernetes上:
我运行我的测试套件java。
第一个测试套件有时会连续失败,但第二个测试套件每次都会失败。
测试成功时,我有日志org.openqa.selenium.remote.ProtocolHandshake createSession
,但失败时却没有此日志。
我用
启动zaleniumdefault parameters
或
DESIRED_CONTAINERS : 1
MAX_TEST_SESSIONS : 10
other default parameters
或
DESIRED_CONTAINERS : 1
或
DESIRED_CONTAINERS : 2
我总是有相同的结果。 你有什么解释吗?
要复制:
ChromeOptions capabilities = new ChromeOptions();
capabilities.setExperimentalOption("w3c", false);
capabilities.setCapability("name", VIDEO_FILE_NAME);
driver = new RemoteWebDriver(new URL(REMOTE_URL), capabilities);
FirefoxOptions capFF = new FirefoxOptions();
capFF.setCapability("name", VIDEO_FILE_NAME);
driver = new RemoteWebDriver(new URL(REMOTE_URL), capFF);
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pod
name: pod
namespace: test-ns
spec:
replicas: 1
selector:
matchLabels:
app: pod
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: pod
spec:
serviceAccountName: test-sa
containers:
- image: dosel/zalenium
imagePullPolicy: IfNotPresent
name: pod
securityContext:
privileged: true
env:
- name: DESIRED_CONTAINERS
value: "1"
readinessProbe:
httpGet:
port: 4444
path: /status
ports:
- containerPort: 4444
hostPort: 4444
protocol: TCP
name: gate
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-sock
- mountPath: /home/seluser/videos
name: video
args:
- start
initContainers:
- name: video-pvc-init
image: busybox
command: ["/bin/chmod","-R","777", "/home/seluser/videos"]
volumeMounts:
- mountPath: /home/seluser/videos
name: video
volumes:
- hostPath:
path: /var/run/docker.sock
name: docker-sock
- persistentVolumeClaim:
claimName: video-pvc
name: video
MAX_DOCKER_SELENIUM_CONTAINERS
谢谢