From 3a8af97eb94168a963a27f3ebedca9f0512f4598 Mon Sep 17 00:00:00 2001 From: Sanket Sudake Date: Thu, 3 Jun 2021 10:57:10 +0530 Subject: [PATCH] Wait for small time to avoid timeout in specs tests (#2052) Signed-off-by: Sanket Sudake --- .../test_spec_merge/test_spec_merge.sh | 21 ++++++++++++------- test/tests/test_specs/test_spec_multifile.sh | 3 +++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/test/tests/test_specs/test_spec_merge/test_spec_merge.sh b/test/tests/test_specs/test_spec_merge/test_spec_merge.sh index e9c0188a..a10c6cc9 100755 --- a/test/tests/test_specs/test_spec_merge/test_spec_merge.sh +++ b/test/tests/test_specs/test_spec_merge/test_spec_merge.sh @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail +source $(dirname $0)/../../../utils.sh env_p=nodep fn_p=nodehellop @@ -19,19 +20,23 @@ pushd $(dirname $0) fission spec apply +log "Waiting for changes to reflect" +sleep 5 + +fission fn list | grep $fn_p fission fn test --name $fn_p + +fission fn list | grep $fn_nd fission fn test --name $fn_nd hnd=$(kubectl -n $FUNCTION_NAMESPACE get deployment -l=functionName=$fn_nd -ojsonpath='{.items[0].spec.template.spec.hostname}') -if [[ "${hnd}" == "foo-bar" ]] - then - echo "Hostname matches for newdeployment function, podspec test 1/2 passsed" - fi +if [[ "${hnd}" == "foo-bar" ]]; then + echo "Hostname matches for newdeployment function, podspec test 1/2 passsed" +fi hnp=$(kubectl -n $FUNCTION_NAMESPACE get deployment -l=environmentName=$env_p -ojsonpath='{.items[0].spec.template.spec.hostname}') -if [[ "${hnp}" == "foo-bar" ]] - then - echo "Hostname matches for poolmgr function, podspec test 2/2 passsed" - fi +if [[ "${hnp}" == "foo-bar" ]]; then + echo "Hostname matches for poolmgr function, podspec test 2/2 passsed" +fi diff --git a/test/tests/test_specs/test_spec_multifile.sh b/test/tests/test_specs/test_spec_multifile.sh index ad0586a7..4d42f1a3 100755 --- a/test/tests/test_specs/test_spec_multifile.sh +++ b/test/tests/test_specs/test_spec_multifile.sh @@ -40,6 +40,9 @@ fission fn create --spec --name $fn --env $env --deploy "multifile/*" --entrypoi log "Applying specs" fission spec apply +log "Waiting for changes to reflect" +sleep 5 + log "Checking function's existance" fission fn list | grep $fn