Skip to content

Commit

Permalink
Merge pull request #1253 from antip00/0.22.0-slow-propagation-test
Browse files Browse the repository at this point in the history
[wip] 0.22.0 slow propagation test
  • Loading branch information
alex-zaitsev authored Oct 20, 2023
2 parents 24859ff + 599ecda commit f48e098
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 76 deletions.
6 changes: 3 additions & 3 deletions tests/e2e/kubectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import e2e.util as util

current_dir = os.path.dirname(os.path.abspath(__file__))
max_retries = 20
max_retries = 35


def launch(command, ok_to_fail=False, ns=None, timeout=600, shell=None):
Expand Down Expand Up @@ -118,7 +118,7 @@ def delete_all_keeper(ns=None):
launch(f"delete {resource_type} -n {current().context.test_namespace} {name}", ok_to_fail=True)


def create_and_check(manifest, check, ns=None, shell=None, timeout=900):
def create_and_check(manifest, check, ns=None, shell=None, timeout=1800):
chi_name = yaml_manifest.get_chi_name(util.get_full_path(f"{manifest}"))

# state_field = ".status.taskID"
Expand Down Expand Up @@ -292,7 +292,7 @@ def delete(manifest, ns=None, timeout=600):
run_shell(f"{manifest} | {current().context.kubectl_cmd} delete -f -", timeout=timeout)


def wait_objects(chi, object_counts, ns=None, shell=None, retries = max_retries):
def wait_objects(chi, object_counts, ns=None, shell=None, retries=max_retries):
with Then(
f"Waiting for: "
f"{object_counts['statefulset']} statefulsets, "
Expand Down
27 changes: 27 additions & 0 deletions tests/e2e/manifests/chi/test-044-0-slow-propagation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: "clickhouse.altinity.com/v1"

kind: "ClickHouseInstallation"

metadata:
name: test-044-slow-propagation

spec:
configuration:
zookeeper:
nodes:
- host: zookeeper
port: 2181
clusters:
- name: default
layout:
shardsCount: 1
replicas:
- templates:
podTemplate: fast-replica
templates:
podTemplates:
- name: fast-replica
spec:
containers:
- name: clickhouse-pod
image: clickhouse/clickhouse-server:22.8
47 changes: 47 additions & 0 deletions tests/e2e/manifests/chi/test-044-1-slow-propagation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: "clickhouse.altinity.com/v1"

kind: "ClickHouseInstallation"

metadata:
name: test-044-slow-propagation

spec:
configuration:
zookeeper:
nodes:
- host: zookeeper
port: 2181
clusters:
- name: default
layout:
shardsCount: 1
replicas:
- templates:
podTemplate: fast-replica
- templates:
podTemplate: slow-replica
templates:
podTemplates:
- name: fast-replica
spec:
containers:
- name: clickhouse-pod
image: clickhouse/clickhouse-server:22.8
- name: slow-replica
spec:
containers:
- name: clickhouse-pod
image: clickhouse/clickhouse-server:22.8
command:
- "/bin/bash"
- "-c"
- "sleep 600 && /entrypoint.sh"
livenessProbe:
exec:
command:
- bash
- -xc
- 'echo 1'
initialDelaySeconds: 700
timeoutSeconds: 15

48 changes: 48 additions & 0 deletions tests/e2e/manifests/chi/test-044-2-slow-propagation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: "clickhouse.altinity.com/v1"

kind: "ClickHouseInstallation"

metadata:
name: test-044-slow-propagation

spec:
taskID: "run reconcile"
configuration:
zookeeper:
nodes:
- host: zookeeper
port: 2181
clusters:
- name: default
layout:
shardsCount: 1
replicas:
- templates:
podTemplate: fast-replica
- templates:
podTemplate: slow-replica
templates:
podTemplates:
- name: fast-replica
spec:
containers:
- name: clickhouse-pod
image: clickhouse/clickhouse-server:22.8
- name: slow-replica
spec:
containers:
- name: clickhouse-pod
image: clickhouse/clickhouse-server:22.8
command:
- "/bin/bash"
- "-c"
- "sleep 600 && /entrypoint.sh"
livenessProbe:
exec:
command:
- bash
- -xc
- 'echo 1'
initialDelaySeconds: 700
timeoutSeconds: 15

9 changes: 9 additions & 0 deletions tests/e2e/manifests/chopconf/test-044-chopconf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseOperatorConfiguration"
metadata:
name: "test-044-chopconf"
spec:
reconcile:
statefulSet:
update:
timeout: 60
2 changes: 1 addition & 1 deletion tests/e2e/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def create_test_namespace(self, force=False):
return self.context.test_namespace


@TestStep(Then)
@TestStep(Finally)
def delete_test_namespace(self):
shell = get_shell()
self.context.shell = shell
Expand Down
Loading

0 comments on commit f48e098

Please sign in to comment.