Skip to content

Commit

Permalink
tests: update slow test lists, skip on windows/386 (#17758)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Sep 28, 2018
1 parent 4d8c724 commit 79ca6c7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
10 changes: 7 additions & 3 deletions tests/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ func TestBlockchain(t *testing.T) {
bt.skipLoad(`^bcTotalDifficultyTest/(lotsOfLeafs|lotsOfBranches|sideChainWithMoreTransactions)`)
// This test is broken
bt.fails(`blockhashNonConstArg_Constantinople`, "Broken test")

// Still failing tests
// bt.skipLoad(`^bcWalletTest.*_Byzantium$`)
// Slow tests
bt.slow(`^bcExploitTest/DelegateCallSpam.json`)
bt.slow(`^bcExploitTest/ShanghaiLove.json`)
bt.slow(`^bcExploitTest/SuicideIssue.json`)
bt.slow(`^bcForkStressTest/`)
bt.slow(`^bcGasPricerTest/RPC_API_Test.json`)
bt.slow(`^bcWalletTest/`)

bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) {
if err := bt.checkFailure(t, name, test.Run()); err != nil {
Expand Down
17 changes: 11 additions & 6 deletions tests/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"path/filepath"
"reflect"
"regexp"
"runtime"
"sort"
"strings"
"testing"
Expand Down Expand Up @@ -90,7 +91,7 @@ type testMatcher struct {
configpat []testConfig
failpat []testFailure
skiploadpat []*regexp.Regexp
skipshortpat []*regexp.Regexp
slowpat []*regexp.Regexp
whitelistpat *regexp.Regexp
}

Expand All @@ -105,8 +106,8 @@ type testFailure struct {
}

// skipShortMode skips tests matching when the -short flag is used.
func (tm *testMatcher) skipShortMode(pattern string) {
tm.skipshortpat = append(tm.skipshortpat, regexp.MustCompile(pattern))
func (tm *testMatcher) slow(pattern string) {
tm.slowpat = append(tm.slowpat, regexp.MustCompile(pattern))
}

// skipLoad skips JSON loading of tests matching the pattern.
Expand All @@ -133,11 +134,15 @@ func (tm *testMatcher) config(pattern string, cfg params.ChainConfig) {

// findSkip matches name against test skip patterns.
func (tm *testMatcher) findSkip(name string) (reason string, skipload bool) {
if testing.Short() {
for _, re := range tm.skipshortpat {
if re.MatchString(name) {
isWin32 := runtime.GOARCH == "386" && runtime.GOOS == "windows"
for _, re := range tm.slowpat {
if re.MatchString(name) {
if testing.Short() {
return "skipped in -short mode", false
}
if isWin32 {
return "skipped on 32bit windows", false
}
}
}
for _, re := range tm.skiploadpat {
Expand Down
10 changes: 9 additions & 1 deletion tests/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ func TestState(t *testing.T) {

st := new(testMatcher)
// Long tests:
st.skipShortMode(`^stQuadraticComplexityTest/`)
st.slow(`^stAttackTest/ContractCreationSpam`)
st.slow(`^stBadOpcode/badOpcodes`)
st.slow(`^stPreCompiledContracts/modexp`)
st.slow(`^stQuadraticComplexityTest/`)
st.slow(`^stStaticCall/static_Call50000`)
st.slow(`^stStaticCall/static_Return50000`)
st.slow(`^stStaticCall/static_Call1MB`)
st.slow(`^stSystemOperationsTest/CallRecursiveBomb`)
st.slow(`^stTransactionTest/Opcodes_TransactionInit`)
// Broken tests:
st.skipLoad(`^stTransactionTest/OverflowGasRequire\.json`) // gasLimit > 256 bits
st.skipLoad(`^stTransactionTest/zeroSigTransa[^/]*\.json`) // EIP-86 is not supported yet
Expand Down
6 changes: 1 addition & 5 deletions tests/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ import (
func TestVM(t *testing.T) {
t.Parallel()
vmt := new(testMatcher)
vmt.slow("^vmPerformance")
vmt.fails("^vmSystemOperationsTest.json/createNameRegistrator$", "fails without parallel execution")

vmt.skipLoad(`^vmInputLimits(Light)?.json`) // log format broken

vmt.skipShortMode("^vmPerformanceTest.json")
vmt.skipShortMode("^vmInputLimits(Light)?.json")

vmt.walk(t, vmTestDir, func(t *testing.T, name string, test *VMTest) {
withTrace(t, test.json.Exec.GasLimit, func(vmconfig vm.Config) error {
return vmt.checkFailure(t, name, test.Run(vmconfig))
Expand Down

0 comments on commit 79ca6c7

Please sign in to comment.