From a1918358b3e30248c6765ece49cf1c4b7dc2b5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 11:11:05 +0100 Subject: [PATCH 1/9] Run CI (tests) on MacOS --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b425f6f03f2a..72d236257f2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: go-version: [1.20.x] - platform: [ubuntu-latest, windows-2019] + platform: [ubuntu-latest, windows-2019, macos-latest] runs-on: ${{ matrix.platform }} steps: - name: Checkout code @@ -49,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-latest, windows-2019] + platform: [ubuntu-latest, windows-2019, macos-latest] runs-on: ${{ matrix.platform }} continue-on-error: true steps: @@ -88,7 +88,7 @@ jobs: fail-fast: false matrix: go-version: [1.21.x] - platform: [ubuntu-latest, windows-2019] + platform: [ubuntu-latest, windows-2019, macos-latest] runs-on: ${{ matrix.platform }} steps: - name: Checkout code From c91970dbf3e020d0e7de6df61b3d5ef1d77ca1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 11:24:58 +0100 Subject: [PATCH 2/9] Increase test sleep time to reduce flakiness --- js/runner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/runner_test.go b/js/runner_test.go index c58d837af816..bf7611667741 100644 --- a/js/runner_test.go +++ b/js/runner_test.go @@ -765,7 +765,7 @@ func TestVURunInterruptDoesntPanic(t *testing.T) { assert.Contains(t, vuErr.Error(), "context canceled") }() <-ch - time.Sleep(time.Millisecond * 1) // NOTE: increase this in case of problems ;) + time.Sleep(time.Millisecond * 10) // NOTE: increase this in case of problems ;) newCancel() wg.Wait() } From 95796535fa73cfc3c74d2e8d89db804cc7ffa60d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 11:31:29 +0100 Subject: [PATCH 3/9] Increase test sleep time to reduce flakiness --- js/runner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/runner_test.go b/js/runner_test.go index bf7611667741..8272221f7fef 100644 --- a/js/runner_test.go +++ b/js/runner_test.go @@ -765,7 +765,7 @@ func TestVURunInterruptDoesntPanic(t *testing.T) { assert.Contains(t, vuErr.Error(), "context canceled") }() <-ch - time.Sleep(time.Millisecond * 10) // NOTE: increase this in case of problems ;) + time.Sleep(time.Millisecond * 100) // NOTE: increase this in case of problems ;) newCancel() wg.Wait() } From 0fccc3bf8e340185182ec482854c03a3b919c35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 11:39:38 +0100 Subject: [PATCH 4/9] Decrease test sleep time to reduce flakiness --- js/runner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/runner_test.go b/js/runner_test.go index 8272221f7fef..14e59b711d3c 100644 --- a/js/runner_test.go +++ b/js/runner_test.go @@ -765,7 +765,7 @@ func TestVURunInterruptDoesntPanic(t *testing.T) { assert.Contains(t, vuErr.Error(), "context canceled") }() <-ch - time.Sleep(time.Millisecond * 100) // NOTE: increase this in case of problems ;) + time.Sleep(time.Microsecond * 1) // NOTE: increase this in case of problems ;) newCancel() wg.Wait() } From 70afbe53ebde7bf44b1492e8f53158bd42131e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 11:53:52 +0100 Subject: [PATCH 5/9] Reduce concurrency on MacOS --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72d236257f2c..ec230c3fa8ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: export GOMAXPROCS=2 args=("-p" "2" "-race") # Run with less concurrency on Windows to minimize flakiness. - if [[ "${{ matrix.platform }}" == windows* ]]; then + if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then unset args[2] args[1]="1" export GOMAXPROCS=1 @@ -76,7 +76,7 @@ jobs: export GOMAXPROCS=2 args=("-p" "2" "-race") # Run with less concurrency on Windows to minimize flakiness. - if [[ "${{ matrix.platform }}" == windows* ]]; then + if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then unset args[2] args[1]="1" export GOMAXPROCS=1 @@ -104,7 +104,7 @@ jobs: export GOMAXPROCS=2 args=("-p" "2" "-race") # Run with less concurrency on Windows to minimize flakiness. - if [[ "${{ matrix.platform }}" == windows* ]]; then + if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then unset args[2] args[1]="1" export GOMAXPROCS=1 From fec9ed6bfdc7882338ae9617e67732a4e7a26639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 15:48:12 +0100 Subject: [PATCH 6/9] Set test sleep time back to its original value --- js/runner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/runner_test.go b/js/runner_test.go index 14e59b711d3c..c58d837af816 100644 --- a/js/runner_test.go +++ b/js/runner_test.go @@ -765,7 +765,7 @@ func TestVURunInterruptDoesntPanic(t *testing.T) { assert.Contains(t, vuErr.Error(), "context canceled") }() <-ch - time.Sleep(time.Microsecond * 1) // NOTE: increase this in case of problems ;) + time.Sleep(time.Millisecond * 1) // NOTE: increase this in case of problems ;) newCancel() wg.Wait() } From 013156156125ee4c3a07633f2ccc41ab139f1f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 15:56:53 +0100 Subject: [PATCH 7/9] Aliasing sha256sum for MacOS --- .github/workflows/test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec230c3fa8ff..df9f05fe5fd2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: go version export GOMAXPROCS=2 args=("-p" "2" "-race") - # Run with less concurrency on Windows to minimize flakiness. + # Run with less concurrency on Windows/MacOS to minimize flakiness. if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then unset args[2] args[1]="1" @@ -75,7 +75,7 @@ jobs: go version export GOMAXPROCS=2 args=("-p" "2" "-race") - # Run with less concurrency on Windows to minimize flakiness. + # Run with less concurrency on Windows/MacOS to minimize flakiness. if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then unset args[2] args[1]="1" @@ -103,7 +103,7 @@ jobs: go version export GOMAXPROCS=2 args=("-p" "2" "-race") - # Run with less concurrency on Windows to minimize flakiness. + # Run with less concurrency on Windows/MacOS to minimize flakiness. if [[ "${{ matrix.platform }}" == windows* || "${{ matrix.platform }}" == macos* ]]; then unset args[2] args[1]="1" @@ -126,6 +126,9 @@ jobs: CODECOV_BASH_SHA512SUM: d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | + if [ "$(uname)" = "Darwin" ]; then + alias sha256sum='shasum -a 256' + fi curl -fsSLO "https://raw.githubusercontent.com/codecov/codecov-bash/${CODECOV_BASH_VERSION}/codecov" echo "$CODECOV_BASH_SHA512SUM codecov" | sha512sum -c - platform="${{ matrix.platform }}" From 68abb7f3a9e3ae3a3dc4fc6cbc9a20e9212c6623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 17:29:22 +0100 Subject: [PATCH 8/9] Decrease test sleep time to reduce flakiness --- js/runner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/runner_test.go b/js/runner_test.go index c58d837af816..14e59b711d3c 100644 --- a/js/runner_test.go +++ b/js/runner_test.go @@ -765,7 +765,7 @@ func TestVURunInterruptDoesntPanic(t *testing.T) { assert.Contains(t, vuErr.Error(), "context canceled") }() <-ch - time.Sleep(time.Millisecond * 1) // NOTE: increase this in case of problems ;) + time.Sleep(time.Microsecond * 1) // NOTE: increase this in case of problems ;) newCancel() wg.Wait() } From 2814ddf5fe4af9437e7bdd121ab64276f7903aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Thu, 11 Jan 2024 18:47:57 +0100 Subject: [PATCH 9/9] Fix shasum alias (:facepalm:) --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df9f05fe5fd2..fd344927694c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -126,8 +126,9 @@ jobs: CODECOV_BASH_SHA512SUM: d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | - if [ "$(uname)" = "Darwin" ]; then - alias sha256sum='shasum -a 256' + if [[ "${{ matrix.platform }}" == macos* ]]; then + shopt -s expand_aliases + alias sha512sum='shasum -a 512' fi curl -fsSLO "https://raw.githubusercontent.com/codecov/codecov-bash/${CODECOV_BASH_VERSION}/codecov" echo "$CODECOV_BASH_SHA512SUM codecov" | sha512sum -c -