@@ -383,7 +383,12 @@ jobs:
383
383
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
384
384
fi
385
385
export TS_DEBUG_DISCO=true
386
- gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" --rerun-fails=2 \
386
+ TEST_RETRIES="--rerun-fails=2"
387
+ if [ "${{ github.ref }}" == "refs/heads/hugodutka/disable-test-retries-on-main" ]; then
388
+ # on main, run tests without retries
389
+ TEST_RETRIES=""
390
+ fi
391
+ gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" $TEST_RETRIES \
387
392
--packages="./..." -- $PARALLEL_FLAG -short
388
393
389
394
- name : Upload Test Cache
@@ -547,16 +552,20 @@ jobs:
547
552
TESTCOUNT="-count=1"
548
553
fi
549
554
555
+ TEST_RETRIES="--rerun-fails=2 --rerun-fails-max-failures=50"
556
+ if [ "${{ github.ref }}" == "refs/heads/hugodutka/disable-test-retries-on-main" ]; then
557
+ # on main, run tests without retries
558
+ TEST_RETRIES=""
559
+ fi
560
+
550
561
mkdir -p "$RUNNER_TEMP/sym"
551
562
source scripts/normalize_path.sh
552
563
# terraform gets installed in a random directory, so we need to normalize
553
564
# the path to the terraform binary or a bunch of cached tests will be
554
565
# invalidated. See scripts/normalize_path.sh for more details.
555
566
normalize_path_with_symlinks "$RUNNER_TEMP/sym" "$(dirname $(which terraform))"
556
567
557
- # We rerun failing tests to counteract flakiness coming from Postgres
558
- # choking on macOS and Windows sometimes.
559
- DB=ci gotestsum --rerun-fails=2 --rerun-fails-max-failures=50 \
568
+ DB=ci gotestsum $TEST_RETRIES \
560
569
--format standard-quiet --packages "./..." \
561
570
-- -timeout=20m -v -p $NUM_PARALLEL_PACKAGES -parallel=$NUM_PARALLEL_TESTS $TESTCOUNT
562
571
@@ -619,8 +628,12 @@ jobs:
619
628
env :
620
629
POSTGRES_VERSION : " 17"
621
630
TS_DEBUG_DISCO : " true"
622
- TEST_RETRIES : 2
623
631
run : |
632
+ export TEST_RETRIES="2"
633
+ if [ "${{ github.ref }}" == "refs/heads/hugodutka/disable-test-retries-on-main" ]; then
634
+ # on main, run tests without retries
635
+ export TEST_RETRIES=""
636
+ fi
624
637
make test-postgres
625
638
626
639
- name : Upload Test Cache
@@ -670,7 +683,12 @@ jobs:
670
683
# c.f. discussion on https://github.com/coder/coder/pull/15106
671
684
- name : Run Tests
672
685
run : |
673
- gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4
686
+ TEST_RETRIES="--rerun-fails=2 --rerun-fails-abort-on-data-race"
687
+ if [ "${{ github.ref }}" == "refs/heads/hugodutka/disable-test-retries-on-main" ]; then
688
+ # on main, run tests without retries
689
+ TEST_RETRIES=""
690
+ fi
691
+ gotestsum --junitfile="gotests.xml" --packages="./..." $TEST_RETRIES -- -race -parallel 4 -p 4
674
692
675
693
- name : Upload Test Cache
676
694
uses : ./.github/actions/test-cache/upload
@@ -721,8 +739,13 @@ jobs:
721
739
env :
722
740
POSTGRES_VERSION : " 17"
723
741
run : |
742
+ TEST_RETRIES="--rerun-fails=2 --rerun-fails-abort-on-data-race"
743
+ if [ "${{ github.ref }}" == "refs/heads/hugodutka/disable-test-retries-on-main" ]; then
744
+ # on main, run tests without retries
745
+ TEST_RETRIES=""
746
+ fi
724
747
make test-postgres-docker
725
- DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4
748
+ DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." $TEST_RETRIES -- -race -parallel 4 -p 4
726
749
727
750
- name : Upload Test Cache
728
751
uses : ./.github/actions/test-cache/upload
0 commit comments