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

ci(-race): race condition with -race flag #2663

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .github/workflows/test_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,16 @@ jobs:
verbose: true # keep this enable as it help debugging when coverage fail randomly on the CI

# TODO: We have to fix race conditions before running this job
# test-with-race:
# runs-on: ubuntu-latest
# steps:
# - name: Install Go
# uses: actions/setup-go@v5
# with:
# go-version: ${{ inputs.go-version }}
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Go race test
# run: go test -race -timeout ${{ inputs.tests-timeout }} ./...
# working-directory: ${{ inputs.modulepath }}
test-with-race:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Go race test
run:
go test -race -timeout ${{ inputs.tests-timeout }} ./...
working-directory: ${{ inputs.modulepath }}
6 changes: 0 additions & 6 deletions gno.land/pkg/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ import (
)

func TestTestdata(t *testing.T) {
t.Parallel()

RunGnolandTestscripts(t, "testdata")
}

func TestUnquote(t *testing.T) {
t.Parallel()

cases := []struct {
Input string
Expected []string
Expand All @@ -40,8 +36,6 @@ func TestUnquote(t *testing.T) {
for _, tc := range cases {
tc := tc
t.Run(tc.Input, func(t *testing.T) {
t.Parallel()

// split by whitespace to simulate command-line arguments
args := strings.Split(tc.Input, " ")
unquotedArgs, err := unquote(args)
Expand Down
1 change: 1 addition & 0 deletions gnovm/stdlibs/bytes/bytes_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ func benchBytes(b *testing.B, sizes []int, f func(b *testing.B, n int)) {
continue
}
*/

b.Run(valName(n), func(b *testing.B) {
if len(bmbuf) < n {
bmbuf = make([]byte, n)
Expand Down
8 changes: 4 additions & 4 deletions gnovm/stdlibs/math/overflow/overflow.gno
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func Div8p(a, b int8) int8 {
func Quo8(a, b int8) (int8, int8, bool) {
if b == 0 {
return 0, 0, false
} else if b == -1 && a == math.MinInt8 {
} else if b == -1 && a == int8(math.MinInt8) {
return 0, 0, false
}
c := a / b
Expand Down Expand Up @@ -313,7 +313,7 @@ func Div16p(a, b int16) int16 {
func Quo16(a, b int16) (int16, int16, bool) {
if b == 0 {
return 0, 0, false
} else if b == -1 && a == math.MinInt16 {
} else if b == -1 && a == int16(math.MinInt16) {
return 0, 0, false
}
c := a / b
Expand Down Expand Up @@ -403,7 +403,7 @@ func Div32p(a, b int32) int32 {
func Quo32(a, b int32) (int32, int32, bool) {
if b == 0 {
return 0, 0, false
} else if b == -1 && a == math.MinInt32 {
} else if b == -1 && a == int32(math.MinInt32) {
return 0, 0, false
}
c := a / b
Expand Down Expand Up @@ -493,7 +493,7 @@ func Div64p(a, b int64) int64 {
func Quo64(a, b int64) (int64, int64, bool) {
if b == 0 {
return 0, 0, false
} else if b == -1 && a == math.MinInt64 {
} else if b == -1 && a == int64(math.MinInt64) {
return 0, 0, false
}
c := a / b
Expand Down
Loading
Loading