Skip to content

Commit

Permalink
fix: flake in test_allow_volume_creation_with_degraded_availability_csi
Browse files Browse the repository at this point in the history
Wait for scheduled condition to be have status true.

Longhorn 9035

Signed-off-by: Eric Weber <eric.weber@suse.com>
  • Loading branch information
ejweber authored and yangchiu committed Jul 19, 2024
1 parent 9a80542 commit 6baa532
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions manager/integration/tests/test_csi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from common import pod as pod_manifest # NOQA
from common import Mi, Gi, DEFAULT_VOLUME_SIZE, EXPANDED_VOLUME_SIZE
from common import VOLUME_RWTEST_SIZE
from common import VOLUME_CONDITION_SCHEDULED
from common import SETTING_REPLICA_NODE_SOFT_ANTI_AFFINITY
from common import SETTING_REPLICA_REPLENISHMENT_WAIT_INTERVAL
from common import LONGHORN_NAMESPACE
Expand Down Expand Up @@ -858,7 +857,11 @@ def test_allow_volume_creation_with_degraded_availability_csi(
namespace='default',
name=deployment_name)
vol = common.wait_for_volume_detached(client, vol.name)
assert vol.conditions[VOLUME_CONDITION_SCHEDULED]['status'] == "True"
# The volume condition cannot change in the same reconcile loop as the
# volume state changes to detached. We need to wait for the condition
# change instead of just checking it once directly.
common.wait_for_volume_condition_scheduled(client, vol.name, "status",
common.CONDITION_STATUS_TRUE)

deployment['spec']['replicas'] = 1
apps_api.patch_namespaced_deployment(body=deployment,
Expand Down

0 comments on commit 6baa532

Please sign in to comment.