Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: test with Go 1.22 #1352

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: 'oldstable'
- uses: actions/checkout@v4
- run: go mod tidy && git diff --exit-code go.mod go.sum
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ '1.20', '1.21' ]
version: [ 'oldstable', 'stable' ]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 I love this - thank you!

name: Go ${{ matrix.version }}
steps:
- uses: actions/setup-go@v5
Expand Down
6 changes: 6 additions & 0 deletions integration/profiling_go1.21_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build !go1.22

package integration_test

// lockContestPrefix is the function name prefix with Go 1.21 and earlier
const lockContestPrefix = "lock_contest_test.glob.."
6 changes: 6 additions & 0 deletions integration/profiling_go1.22_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build go1.22

package integration_test

// lockContestPrefix is the function name prefix with Go 1.22 and later
const lockContestPrefix = "lock_contest_test.init."
9 changes: 5 additions & 4 deletions integration/profiling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,14 @@ var _ = Describe("Profiling Specs", func() {
// The MutexProfile for the lock_contest test should list two functions that wait on a lock.
// Unfortunately go doesn't seem to capture the names of the functions - so they're listed here as
// lock_contest_test.glob..func1.1 is called 10 times and takes ~5ms per call
// lock_contest_test.glob..func2.1 is called once and teakes ~500ms per call
// lock_contest_test.glob..func2.1 is called once and takes ~500ms per call
// Note that in Go 1.22 and later, the functions are called lock_contest_test.init.func1.1 and lock_contest_test.init.func2.1
// Asserting that both times are within a range should be stable across tests. The function names should be as well
// but that might become a source of failure in the future
// Note: these numbers are adjusted slightly to tolerate variance during test runs
Ω(mutexProfile.FindCaller("lock_contest_test.glob..func1.1").CumStat).Should(BeNumerically(">=", 45))
Ω(mutexProfile.FindCaller("lock_contest_test.glob..func1.1").CumStat).Should(BeNumerically("<", 500))
Ω(mutexProfile.FindCaller("lock_contest_test.glob..func2.1").CumStat).Should(BeNumerically(">=", 450))
Ω(mutexProfile.FindCaller(fmt.Sprintf("%sfunc1.1", lockContestPrefix)).CumStat).Should(BeNumerically(">=", 45))
Ω(mutexProfile.FindCaller(fmt.Sprintf("%sfunc1.1", lockContestPrefix)).CumStat).Should(BeNumerically("<", 500))
Ω(mutexProfile.FindCaller(fmt.Sprintf("%sfunc2.1", lockContestPrefix)).CumStat).Should(BeNumerically(">=", 450))
},

Entry("when running in series",
Expand Down