-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix vdrproxy CI job intermittent failures (#994)
* Fix vdrproxy CI job intermittent failures (#994) Signed-off-by: Bogdan Mircea <mirceapetrebogdan@gmail.com>
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: "check-ports" | ||
description: 'Checks whether a space separated list of local ports is reachable' | ||
|
||
inputs: | ||
ports: | ||
description: 'The local ports to check' | ||
required: true | ||
tries: | ||
description: 'The max number of times to check whether each port is open' | ||
required: false | ||
default: 100 | ||
interval: | ||
description: 'The interval to wait in between tries' | ||
required: false | ||
default: 5 | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Check ports" | ||
shell: bash | ||
run: | | ||
for p in ${{ inputs.ports }}; do | ||
counter=0 | ||
while [[ `nc -z localhost $p; echo $?` -ne 0 && $counter -ne ${{ inputs.tries }} ]]; do | ||
sleep ${{ inputs.interval }} | ||
counter=$(( $counter + 1 )) | ||
done | ||
if [[ $counter -eq ${{ inputs.tries }} ]]; then | ||
echo "Port $p is unreachable!" | ||
exit 1; | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters