@@ -538,6 +538,47 @@ jobs:
538
538
with :
539
539
api-key : ${{ secrets.DATADOG_API_KEY }}
540
540
541
+ test-go-race-pg :
542
+ runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
543
+ needs : changes
544
+ if : needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
545
+ timeout-minutes : 25
546
+ steps :
547
+ - name : Harden Runner
548
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
549
+ with :
550
+ egress-policy : audit
551
+
552
+ - name : Checkout
553
+ uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
554
+ with :
555
+ fetch-depth : 1
556
+
557
+ - name : Setup Go
558
+ uses : ./.github/actions/setup-go
559
+
560
+ - name : Setup Terraform
561
+ uses : ./.github/actions/setup-tf
562
+
563
+ # We run race tests with reduced parallelism because they use more CPU and we were finding
564
+ # instances where tests appear to hang for multiple seconds, resulting in flaky tests when
565
+ # short timeouts are used.
566
+ # c.f. discussion on https://github.com/coder/coder/pull/15106
567
+ - name : Run Tests
568
+ env :
569
+ POSTGRES_VERSION : " 16"
570
+ run : |
571
+ make test-postgres-docker
572
+ DB=ci gotestsum --junitfile="gotests.xml" -- -race -parallel 4 -p 4 ./...
573
+
574
+ - name : Upload test stats to Datadog
575
+ timeout-minutes : 1
576
+ continue-on-error : true
577
+ uses : ./.github/actions/upload-datadog
578
+ if : always()
579
+ with :
580
+ api-key : ${{ secrets.DATADOG_API_KEY }}
581
+
541
582
# Tailnet integration tests only run when the `tailnet` directory or `go.sum`
542
583
# and `go.mod` are changed. These tests are to ensure we don't add regressions
543
584
# to tailnet, either due to our code or due to updating dependencies.
@@ -815,6 +856,7 @@ jobs:
815
856
- test-go
816
857
- test-go-pg
817
858
- test-go-race
859
+ - test-go-race-pg
818
860
- test-js
819
861
- test-e2e
820
862
- offlinedocs
@@ -862,7 +904,11 @@ jobs:
862
904
if sum(results.values()) == 0:
863
905
print("test-go-pg on windows-2022 failed, but we are temporarily skipping it until it's fixed")
864
906
continue
865
-
907
+
908
+ if job_name == "test-go-race-pg" and result == "failure":
909
+ print("test-go-race-pg failed, but we are temporarily skipping it until it's fixed")
910
+ continue
911
+
866
912
if result in ["failure", "cancelled"]:
867
913
failed = True
868
914
break
0 commit comments