Merge pull request #16889 from tessapham/fix-scripts

fix test script and lint
This commit is contained in:
Marek Siarkowicz 2023-11-09 15:32:22 +01:00 committed by GitHub
commit 6e30d9ed7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -652,7 +652,7 @@ function run_pass {
local pass="${1}" local pass="${1}"
shift 1 shift 1
log_callout -e "\\n'${pass}' started at $(date)" log_callout -e "\\n'${pass}' started at $(date)"
if "${pass}_pass" "${@}" ; then if "${pass}_pass" "$@" ; then
log_success "'${pass}' PASSED and completed at $(date)" log_success "'${pass}' PASSED and completed at $(date)"
return 0 return 0
else else

View File

@ -248,8 +248,8 @@ func (fkv *fakeKVForCheckCluster) Get(ctx context.Context, key string, opts ...c
}, },
}, },
}, nil }, nil
}
} else if key == clusterMembersKey { if key == clusterMembersKey {
if fkv.getMembersRetries > 0 { if fkv.getMembersRetries > 0 {
fkv.getMembersRetries-- fkv.getMembersRetries--
// discovery client should retry on error. // discovery client should retry on error.
@ -263,11 +263,10 @@ func (fkv *fakeKVForCheckCluster) Get(ctx context.Context, key string, opts ...c
}, },
Kvs: kvs, Kvs: kvs,
}, nil }, nil
} else { }
fkv.t.Errorf("unexpected key: %s", key) fkv.t.Errorf("unexpected key: %s", key)
return nil, fmt.Errorf("unexpected key: %s", key) return nil, fmt.Errorf("unexpected key: %s", key)
} }
}
func TestCheckCluster(t *testing.T) { func TestCheckCluster(t *testing.T) {
actualMemberInfo := []memberInfo{ actualMemberInfo := []memberInfo{