From b195e5f0b36d5629a83aa6c7fb01216e8ddb1e21 Mon Sep 17 00:00:00 2001 From: Abdul Rabbani Date: Wed, 15 Jun 2022 11:33:28 -0400 Subject: [PATCH] Add flakey test and boot command specific logic --- Makefile | 4 +++- entrypoint.sh | 29 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 4306273..7f9f925 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ unit-test-local: go fmt ./... $(GINKGO) -r --label-filter unit \ --randomize-all --randomize-suites \ + --flake-attempts=3 \ --fail-on-pending --keep-going \ --trace @@ -75,7 +76,8 @@ unit-test-ci: go vet ./... go fmt ./... $(GINKGO) -r --label-filter unit \ - --randomize-all --randomize-suites \ + --randomize-all --randomize-suites + --flake-attempts=3 \ --fail-on-pending --keep-going \ --cover --coverprofile=cover.profile \ --trace --json-report=report.json diff --git a/entrypoint.sh b/entrypoint.sh index 63c046c..52b1f0d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,19 +5,20 @@ echo "Starting ipld-eth-beacon-indexer" echo /root/ipld-eth-beacon-indexer capture ${CAPTURE_MODE} --config /root/ipld-eth-beacon-config.json > /root/ipld-eth-beacon-indexer.output -exec /root/ipld-eth-beacon-indexer capture ${CAPTURE_MODE} --config /root/ipld-eth-beacon-config.json > /root/ipld-eth-beacon-indexer.output -rv=$? +if [ ${CAPTURE_MODE} == "boot" ]; then + /root/ipld-eth-beacon-indexer capture ${CAPTURE_MODE} --config /root/ipld-eth-beacon-config.json > /root/ipld-eth-beacon-indexer.output + rv=$? -if [ $rv != 0 ]; then - echo "ipld-eth-beacon-indexer failed" - echo $rv > /root/HEALTH - echo $rv - cat /root/ipld-eth-beacon-indexer.output + if [ $rv != 0 ]; then + echo "ipld-eth-beacon-indexer boot failed" + else + echo "ipld-eth-beacon-indexer boot succeeded" + fi + echo $rv > /root/HEALTH + echo $rv + cat /root/ipld-eth-beacon-indexer.output + + tail -f /dev/null else - echo "ipld-eth-beacon-indexer succeeded" - echo $rv > /root/HEALTH - echo $rv - cat /root/ipld-eth-beacon-indexer.output -fi - -tail -f /dev/null \ No newline at end of file + exec /root/ipld-eth-beacon-indexer capture ${CAPTURE_MODE} --config /root/ipld-eth-beacon-config.json > /root/ipld-eth-beacon-indexer.output +fi \ No newline at end of file