From 3d228bf1a85a6cddc40b5aa0d43f27c0447f8bef Mon Sep 17 00:00:00 2001
From: Michal Nasiadka <mnasiadka@gmail.com>
Date: Mon, 4 Sep 2023 11:39:21 +0000
Subject: [PATCH] Revert "CI: retry smoke tests and instance creation"

This reverts commit 2524ec422d2f8ff74a27282067f7a99fecc676f2.

Reason for revert: I don't think we need it anymore

Change-Id: I9f2871cf3de1a09952fc5c236da2f78e4d930bf5
---
 tests/test-core-openstack.sh | 78 +++++-------------------------------
 1 file changed, 11 insertions(+), 67 deletions(-)

diff --git a/tests/test-core-openstack.sh b/tests/test-core-openstack.sh
index cbe61666e..012d29072 100755
--- a/tests/test-core-openstack.sh
+++ b/tests/test-core-openstack.sh
@@ -8,52 +8,11 @@ set -o pipefail
 export PYTHONUNBUFFERED=1
 
 function test_smoke {
-    attempts=10
-
-    for i in $(seq 1 ${attempts}); do
-        if openstack --debug compute service list; then
-            break
-        elif [[ $i -eq ${attempts} ]]; then
-            echo "Failed to list compute services after ${attempts} attempts"
-        else
-            echo "Cannot list compute services, retrying"
-        fi
-        sleep 10
-    done
-
-    for i in $(seq 1 ${attempts}); do
-        if openstack --debug network agent list; then
-            break
-        elif [[ $i -eq ${attempts} ]]; then
-            echo "Failed to list network services after ${attempts} attempts"
-        else
-            echo "Cannot list network services, retrying"
-        fi
-        sleep 10
-    done
-
-    for i in $(seq 1 ${attempts}); do
-        if openstack --debug orchestration service list; then
-            break
-        elif [[ $i -eq ${attempts} ]]; then
-            echo "Failed to list orchestration services after ${attempts} attempts"
-        else
-            echo "Cannot list orchestration services, retrying"
-        fi
-        sleep 10
-    done
-
+    openstack --debug compute service list
+    openstack --debug network agent list
+    openstack --debug orchestration service list
     if [[ $SCENARIO == "cephadm" ]] || [[ $SCENARIO == "zun" ]]; then
-        for i in $(seq 1 ${attempts}); do
-            if openstack --debug volume service list; then
-                break
-            elif [[ $i -eq ${attempts} ]]; then
-                echo "Failed to list volume services after ${attempts} attempts"
-            else
-                echo "Cannot list volume services, retrying"
-            fi
-            sleep 10
-        done
+        openstack --debug volume service list
     fi
 }
 
@@ -207,28 +166,13 @@ function create_instance {
         server_create_extra="${server_create_extra} --config-drive True"
     fi
 
-    attempts=10
-    for i in $(seq 1 ${attempts}); do
-        if openstack server create --wait --image cirros --flavor m1.tiny --key-name mykey --network demo-net ${server_create_extra} ${name}; then
-            # If the status is not ACTIVE, print info, delete instance (for recreation) and exit 1
-            # if exceeded number of attempts
-            if [[ $(openstack server show ${name} -f value -c status) != "ACTIVE" ]]; then
-                echo "FAILED: Instance is not active"
-                openstack --debug server show ${name}
-                openstack server delete ${name}
-                if [[ $i -eq ${attempts} ]]; then
-                    echo "Failed to create instance after ${attempts} attempts"
-                    exit 1
-                fi
-            else
-                break
-            fi
-        else
-            echo "Cannot create instance, retrying"
-            openstack server delete ${name}
-        fi
-        sleep 10
-    done
+    openstack server create --wait --image cirros --flavor m1.tiny --key-name mykey --network demo-net ${server_create_extra} ${name}
+    # If the status is not ACTIVE, print info and exit 1
+    if [[ $(openstack server show ${name} -f value -c status) != "ACTIVE" ]]; then
+        echo "FAILED: Instance is not active"
+        openstack --debug server show ${name}
+        return 1
+    fi
 }
 
 function delete_instance {
-- 
GitLab