From 59af3f6a09399570c8a37b98b90b2d151ac5bb85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Wed, 15 May 2024 21:08:49 +0200 Subject: [PATCH 1/6] Add more checks on sync testnet to avoid critical issues marked as success --- .github/workflows/sync-testnets.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/sync-testnets.yml b/.github/workflows/sync-testnets.yml index ced3416f44e..411f22fd8b3 100644 --- a/.github/workflows/sync-testnets.yml +++ b/.github/workflows/sync-testnets.yml @@ -150,6 +150,23 @@ jobs: exit 0 fi done + + if [[ "$found_bad_log" == true ]]; then + exit 1 + fi + + all_reached_required_count=true + for good_log in "${!good_logs[@]}"; do + if [[ ${good_logs[$good_log]} -lt ${required_count[$good_log]} ]]; then + all_reached_required_count=false + break + fi + done + + if ! $all_reached_required_count; then + echo "Not all required logs were found." + exit 1 + fi - name: Get Consensus Logs if: always() From 3d7faffe169cded8946ac22ca3648ddf226d0d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Wed, 15 May 2024 21:36:38 +0200 Subject: [PATCH 2/6] Fix check --- .github/workflows/sync-testnets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-testnets.yml b/.github/workflows/sync-testnets.yml index 411f22fd8b3..542355d5214 100644 --- a/.github/workflows/sync-testnets.yml +++ b/.github/workflows/sync-testnets.yml @@ -112,7 +112,7 @@ jobs: docker logs -f sedge-execution-client | while read -r line; do echo "$line" - if [[ $found_bad_log == true ]]; then + if [ $found_bad_log = true ]; then ((counter++)) if [ $counter -ge 100 ]; then echo "Exiting after capturing extra logs due to error." From c23c88d83530740c84921113a8d573f18278b002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Wed, 15 May 2024 21:47:56 +0200 Subject: [PATCH 3/6] fix var assignment --- .github/workflows/sync-testnets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-testnets.yml b/.github/workflows/sync-testnets.yml index 542355d5214..39b1364c585 100644 --- a/.github/workflows/sync-testnets.yml +++ b/.github/workflows/sync-testnets.yml @@ -125,7 +125,7 @@ jobs: for bad_log in "${!bad_logs[@]}"; do if [[ "$line" == *"$bad_log"* ]]; then echo "Error: $bad_log found in Docker logs." - $found_bad_log=true + found_bad_log=true continue 2 fi done From 5aa3fbb1159b2ef57f2e0f4448356f0153fc16ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Wed, 15 May 2024 21:50:49 +0200 Subject: [PATCH 4/6] Fix check for bad log --- .github/workflows/sync-testnets.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-testnets.yml b/.github/workflows/sync-testnets.yml index 39b1364c585..c8eeaeefa8c 100644 --- a/.github/workflows/sync-testnets.yml +++ b/.github/workflows/sync-testnets.yml @@ -151,7 +151,7 @@ jobs: fi done - if [[ "$found_bad_log" == true ]]; then + if [ "$found_bad_log" = true ]; then exit 1 fi From b88c6c71fd86b1807677fba674dd270ff1feeeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Wed, 15 May 2024 21:54:22 +0200 Subject: [PATCH 5/6] Improve --- .github/workflows/sync-testnets.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-testnets.yml b/.github/workflows/sync-testnets.yml index c8eeaeefa8c..095a15247f2 100644 --- a/.github/workflows/sync-testnets.yml +++ b/.github/workflows/sync-testnets.yml @@ -112,7 +112,7 @@ jobs: docker logs -f sedge-execution-client | while read -r line; do echo "$line" - if [ $found_bad_log = true ]; then + if ! $found_bad_log; then ((counter++)) if [ $counter -ge 100 ]; then echo "Exiting after capturing extra logs due to error." @@ -151,7 +151,8 @@ jobs: fi done - if [ "$found_bad_log" = true ]; then + if ! $found_bad_log; then + echo "Found bad log, exiting." exit 1 fi From 82db5e8d0f042ac467236f40b390318752a22884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Wed, 15 May 2024 21:55:47 +0200 Subject: [PATCH 6/6] Update sync-testnets.yml --- .github/workflows/sync-testnets.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-testnets.yml b/.github/workflows/sync-testnets.yml index 095a15247f2..49df27c8c85 100644 --- a/.github/workflows/sync-testnets.yml +++ b/.github/workflows/sync-testnets.yml @@ -112,7 +112,7 @@ jobs: docker logs -f sedge-execution-client | while read -r line; do echo "$line" - if ! $found_bad_log; then + if $found_bad_log; then ((counter++)) if [ $counter -ge 100 ]; then echo "Exiting after capturing extra logs due to error." @@ -151,7 +151,7 @@ jobs: fi done - if ! $found_bad_log; then + if $found_bad_log; then echo "Found bad log, exiting." exit 1 fi