Sitelet https://github.com/Altinity/clickhouse-operator/commit/41a5d799ccf226f1c505c2d2e3078d4b464878a8
Skip to content

Commit 41a5d79

Browse files
committed
dev: move test into parallel section
1 parent cce76e6 commit 41a5d79

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎tests/e2e/test_operator.py‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8015,7 +8015,7 @@ def test_010084(self):
80158015
@TestScenario
80168016
@Requirements(RQ_SRS_026_ClickHouseOperator_Managing_ReprovisioningVolume("1.0"))
80178017
@Name("test_010085. Adding a volume under the default provisioner is not data loss")
8018-
@Tags("NO_PARALLEL")
8018+
@Tags("HEAVY")
80198019
def test_010085(self):
80208020
"""Adding a volumeClaimTemplate to a host that already has data must not be treated as
80218021
storage loss.
@@ -8119,13 +8119,22 @@ def test_010085(self):
81198119
):
81208120
note(line)
81218121

8122+
# Scope to THIS CHI. Each scenario installs its own operator into its own namespace
8123+
# (see create_shell_namespace_clickhouse_template), so cross-test contamination is
8124+
# already impossible and this is hardening rather than a fix. It still earns its place:
8125+
# the not-in assertion is the kind that passes when it matches nothing, and pinning it
8126+
# to our own hosts keeps it meaningful if the harness ever moves to a shared operator.
8127+
# The announcer stamps host lines as Host:<name>[s/r]:<namespace>/<CR>.
8128+
scope = f"{current().context.test_namespace}/{chi}"
8129+
ours = [line for line in op_logs.splitlines() if scope in line]
8130+
81228131
# The positive assertion comes first, and it is what keeps the negative one honest: if
8123-
# the PVC classification never ran at all, neither message appears and "no data loss"
8124-
# would hold for the wrong reason.
8125-
assert "Volume added to host" in op_logs, error(
8132+
# the PVC classification never ran at all - or the scope matched nothing - neither
8133+
# message appears and "no data loss" would hold for the wrong reason.
8134+
assert any("Volume added to host" in line for line in ours), error(
81268135
"volume-added path was not entered - the added volumeClaimTemplate was not classified"
81278136
)
8128-
assert "Data loss detected" not in op_logs, error(
8137+
assert not any("Data loss detected" in line for line in ours), error(
81298138
"adding a volume was reported as data loss"
81308139
)
81318140

0 commit comments

Comments
 (0)