This is an automated email from the ASF dual-hosted git repository.

jason810496 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 342157f5aed Go SDK: run unit tests with the race detector in CI 
(#74215)
342157f5aed is described below

commit 342157f5aed6f88dd6d693a6443f088e94c7085a
Author: PoAn Yang <[email protected]>
AuthorDate: Tue Oct 6 16:40:32 2026 +0800

    Go SDK: run unit tests with the race detector in CI (#74215)
    
    Signed-off-by: PoAn Yang <[email protected]>
---
 .github/workflows/ci-amd.yml                             | 5 +++++
 .github/workflows/ci-arm.yml                             | 5 +++++
 dev/breeze/src/airflow_breeze/utils/verification_plan.py | 5 ++++-
 scripts/ci/testing/run_unit_tests.sh                     | 2 +-
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci-amd.yml b/.github/workflows/ci-amd.yml
index 8e670fbebd2..1d4a4340c01 100644
--- a/.github/workflows/ci-amd.yml
+++ b/.github/workflows/ci-amd.yml
@@ -1014,6 +1014,11 @@ jobs:
       - name: Run Go tests
         working-directory: ./go-sdk
         run: gotestsum --format github-actions ./...
+      # Without -race, the Go SDK tests for concurrent use can still pass when 
a lock is missing.
+      # The plain run above has to stay because the race build leaves out 
files with `//go:build !race`.
+      - name: Run Go tests with the race detector
+        working-directory: ./go-sdk
+        run: gotestsum --format github-actions -- -race ./...
       # Go modules have no central registry that pre-scans releases, so we 
scan our own
       # dependency graph against the Go vulnerability database. govulncheck is 
reachability
       # based, so it only fails on advisories that actually affect code we 
call. The version
diff --git a/.github/workflows/ci-arm.yml b/.github/workflows/ci-arm.yml
index 88d7109c944..889ca016b54 100644
--- a/.github/workflows/ci-arm.yml
+++ b/.github/workflows/ci-arm.yml
@@ -1003,6 +1003,11 @@ jobs:
       - name: Run Go tests
         working-directory: ./go-sdk
         run: gotestsum --format github-actions ./...
+      # Without -race, the Go SDK tests for concurrent use can still pass when 
a lock is missing.
+      # The plain run above has to stay because the race build leaves out 
files with `//go:build !race`.
+      - name: Run Go tests with the race detector
+        working-directory: ./go-sdk
+        run: gotestsum --format github-actions -- -race ./...
       # Go modules have no central registry that pre-scans releases, so we 
scan our own
       # dependency graph against the Go vulnerability database. govulncheck is 
reachability
       # based, so it only fails on advisories that actually affect code we 
call. The version
diff --git a/dev/breeze/src/airflow_breeze/utils/verification_plan.py 
b/dev/breeze/src/airflow_breeze/utils/verification_plan.py
index 6e2e73fe69d..6c48ad51cec 100644
--- a/dev/breeze/src/airflow_breeze/utils/verification_plan.py
+++ b/dev/breeze/src/airflow_breeze/utils/verification_plan.py
@@ -46,7 +46,10 @@ FLAG_COMMANDS: dict[str, tuple[tuple[str, str, str], ...]] = 
{
         ),
     ),
     "run_api_codegen": (("schema", "breeze testing python-api-client-tests", 
"breeze"),),
-    "run_go_sdk_tests": (("unit", "cd go-sdk && go test ./...", "host"),),
+    "run_go_sdk_tests": (
+        ("unit", "cd go-sdk && go test ./...", "host"),
+        ("unit", "cd go-sdk && go test -race ./...", "host"),
+    ),
     "run_java_sdk_tests": (
         ("unit", "cd java-sdk && ./gradlew test", "host"),
         ("docs", "breeze build-docs --sdk-docs-only --sdk=java", "breeze"),
diff --git a/scripts/ci/testing/run_unit_tests.sh 
b/scripts/ci/testing/run_unit_tests.sh
index bd54f8a3ce0..aefff5ff13c 100755
--- a/scripts/ci/testing/run_unit_tests.sh
+++ b/scripts/ci/testing/run_unit_tests.sh
@@ -143,7 +143,7 @@ function go_sdk_tests() {
     echo "${COLOR_BLUE}Running Go SDK tests${COLOR_RESET}"
     set -x
     cd go-sdk
-    go test -v ./...
+    go test -v -race ./...
     set +x
     echo "${COLOR_BLUE}Go SDK tests completed${COLOR_RESET}"
 }

Reply via email to