From 35313563c36a66d3c16700c319dbbf41eb121aee Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 1 Oct 2025 15:02:07 +0800 Subject: [PATCH 1/2] ci: add a minimal CI config to run Go tests --- .github/workflows/test.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2c237f4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +on: [push, pull_request] + +jobs: + unit: + strategy: + fail-fast: false + matrix: + os: [ "ubuntu", "windows", "macos" ] + go: [ "1.24.x", "1.25.x" ] + runs-on: ${{ matrix.os }}-latest + name: Tests (${{ matrix.os}}, Go ${{ matrix.go }}) + timeout-minutes: 10 + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-go@v6 + with: + go-version: ${{ matrix.go }} + - run: go version + - name: run tests + run: go test -v -shuffle on ./... From 2c01c1d2828d2d6ab890d6d0ca6ef4b2aa9807a5 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 1 Oct 2025 15:21:01 +0800 Subject: [PATCH 2/2] remove test that uses Go 1.25 features --- v2_encode_test.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/v2_encode_test.go b/v2_encode_test.go index c2df1ea..48c3b5d 100644 --- a/v2_encode_test.go +++ b/v2_encode_test.go @@ -14,9 +14,7 @@ import ( "regexp" "runtime/debug" "strconv" - "sync" "testing" - "testing/synctest" "time" ) @@ -1408,21 +1406,3 @@ func TestIssue63379(t *testing.T) { } } } - -// Issue #73733: encoding/json used a WaitGroup to coordinate access to cache entries. -// Since WaitGroup.Wait is durably blocking, this caused apparent deadlocks when -// multiple bubbles called json.Marshal at the same time. -func TestSynctestMarshal(t *testing.T) { - var wg sync.WaitGroup - for range 5 { - wg.Go(func() { - synctest.Test(t, func(t *testing.T) { - _, err := Marshal([]string{}) - if err != nil { - t.Errorf("Marshal: %v", err) - } - }) - }) - } - wg.Wait() -}