From a608c0ac8449daec2f630aefc4b87ca0838c3789 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi <1591639+s1na@users.noreply.github.com> Date: Fri, 12 Jan 2024 17:44:03 +0330 Subject: [PATCH] cmd/devp2p/internal/ethtest: skip large tx test on github build (#28794) This test was failling consistently on the github 32-bit build probably due to slow IO. Skipping it for that green check. --- .github/workflows/go.yml | 2 +- cmd/devp2p/internal/ethtest/suite.go | 2 +- cmd/devp2p/internal/ethtest/suite_test.go | 3 +++ internal/utesting/utesting.go | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7924c521e..0c673d15f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,7 +17,7 @@ jobs: with: go-version: 1.21.4 - name: Run tests - run: go test ./... + run: go test -short ./... env: GOOS: linux GOARCH: 386 diff --git a/cmd/devp2p/internal/ethtest/suite.go b/cmd/devp2p/internal/ethtest/suite.go index f62d25a83..4f499d41d 100644 --- a/cmd/devp2p/internal/ethtest/suite.go +++ b/cmd/devp2p/internal/ethtest/suite.go @@ -76,9 +76,9 @@ func (s *Suite) EthTests() []utesting.Test { {Name: "TestMaliciousHandshake", Fn: s.TestMaliciousHandshake}, {Name: "TestMaliciousStatus", Fn: s.TestMaliciousStatus}, // test transactions + {Name: "TestLargeTxRequest", Fn: s.TestLargeTxRequest, Slow: true}, {Name: "TestTransaction", Fn: s.TestTransaction}, {Name: "TestInvalidTxs", Fn: s.TestInvalidTxs}, - {Name: "TestLargeTxRequest", Fn: s.TestLargeTxRequest}, {Name: "TestNewPooledTxs", Fn: s.TestNewPooledTxs}, {Name: "TestBlobViolations", Fn: s.TestBlobViolations}, } diff --git a/cmd/devp2p/internal/ethtest/suite_test.go b/cmd/devp2p/internal/ethtest/suite_test.go index 79146c8ab..ad73bc9f9 100644 --- a/cmd/devp2p/internal/ethtest/suite_test.go +++ b/cmd/devp2p/internal/ethtest/suite_test.go @@ -63,6 +63,9 @@ func TestEthSuite(t *testing.T) { } for _, test := range suite.EthTests() { t.Run(test.Name, func(t *testing.T) { + if test.Slow && testing.Short() { + t.Skipf("%s: skipping in -short mode", test.Name) + } result := utesting.RunTests([]utesting.Test{{Name: test.Name, Fn: test.Fn}}, os.Stdout) if result[0].Failed { t.Fatal() diff --git a/internal/utesting/utesting.go b/internal/utesting/utesting.go index ee99794c6..8260de1d7 100644 --- a/internal/utesting/utesting.go +++ b/internal/utesting/utesting.go @@ -35,6 +35,7 @@ import ( type Test struct { Name string Fn func(*T) + Slow bool } // Result is the result of a test execution.