Skip to content

Commit

Permalink
Mark a whole lot of tests to skip on m1 as they core dump
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Mar 7, 2022
1 parent c8a7b83 commit feeccb6
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/wasm/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ func TestExecuteWithNonExistingAddress(t *testing.T) {
}

func TestExecuteWithPanic(t *testing.T) {
SkipIfM1(t)
ctx, keepers := CreateTestInput(t, false, SupportedFeatures)
keeper := keepers.ContractKeeper

Expand Down Expand Up @@ -703,6 +704,7 @@ func TestExecuteWithPanic(t *testing.T) {
}

func TestExecuteWithCpuLoop(t *testing.T) {
SkipIfM1(t)
ctx, keepers := CreateTestInput(t, false, SupportedFeatures)
keeper := keepers.ContractKeeper

Expand Down Expand Up @@ -745,6 +747,7 @@ func TestExecuteWithCpuLoop(t *testing.T) {
}

func TestExecuteWithStorageLoop(t *testing.T) {
SkipIfM1(t)
ctx, keepers := CreateTestInput(t, false, SupportedFeatures)
keeper := keepers.ContractKeeper

Expand Down Expand Up @@ -786,6 +789,7 @@ func TestExecuteWithStorageLoop(t *testing.T) {
}

func TestMigrate(t *testing.T) {
SkipIfM1(t)
ctx, keepers := CreateTestInput(t, false, SupportedFeatures)
keeper := keepers.ContractKeeper

Expand Down Expand Up @@ -967,6 +971,7 @@ func TestMigrate(t *testing.T) {
}

func TestMigrateReplacesTheSecondIndex(t *testing.T) {
SkipIfM1(t)
ctx, keepers := CreateTestInput(t, false, SupportedFeatures)
example := InstantiateHackatomExampleContract(t, ctx, keepers)

Expand Down
12 changes: 12 additions & 0 deletions x/wasm/keeper/m1compat.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package keeper

import (
"runtime"
"testing"
)

func SkipIfM1(t *testing.T) {
if runtime.GOARCH == "arm64" {
t.Skip("Skipping for M1: Signal Error, Stack Dump")
}
}
2 changes: 2 additions & 0 deletions x/wasm/keeper/recurse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ func TestGasOnExternalQuery(t *testing.T) {
}

func TestLimitRecursiveQueryGas(t *testing.T) {
SkipIfM1(t)

// The point of this test from https://github.com/CosmWasm/cosmwasm/issues/456
// Basically, if I burn 90% of gas in CPU loop, then query out (to my self)
// the sub-query will have all the original gas (minus the 40k instance charge)
Expand Down
6 changes: 6 additions & 0 deletions x/wasm/keeper/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func mustParse(t *testing.T, data []byte, res interface{}) {
const ReflectFeatures = "staking,mask,stargate"

func TestReflectContractSend(t *testing.T) {
SkipIfM1(t)
cdc := MakeEncodingConfig(t).Marshaler
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)))
accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper
Expand Down Expand Up @@ -167,6 +168,7 @@ func TestReflectContractSend(t *testing.T) {
}

func TestReflectCustomMsg(t *testing.T) {
SkipIfM1(t)
cdc := MakeEncodingConfig(t).Marshaler
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper
Expand Down Expand Up @@ -260,6 +262,7 @@ func TestReflectCustomMsg(t *testing.T) {
}

func TestMaskReflectCustomQuery(t *testing.T) {
SkipIfM1(t)
cdc := MakeEncodingConfig(t).Marshaler
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper
Expand Down Expand Up @@ -310,6 +313,7 @@ func TestMaskReflectCustomQuery(t *testing.T) {
}

func TestReflectStargateQuery(t *testing.T) {
SkipIfM1(t)
cdc := MakeEncodingConfig(t).Marshaler
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper
Expand Down Expand Up @@ -387,6 +391,7 @@ type reflectState struct {
}

func TestMaskReflectWasmQueries(t *testing.T) {
SkipIfM1(t)
cdc := MakeEncodingConfig(t).Marshaler
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper
Expand Down Expand Up @@ -459,6 +464,7 @@ func TestMaskReflectWasmQueries(t *testing.T) {
}

func TestWasmRawQueryWithNil(t *testing.T) {
SkipIfM1(t)
cdc := MakeEncodingConfig(t).Marshaler
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper
Expand Down
6 changes: 6 additions & 0 deletions x/wasm/keeper/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

func TestOnOpenChannel(t *testing.T) {
SkipIfM1(t)
var m wasmtesting.MockWasmer
wasmtesting.MakeIBCInstantiable(&m)
var messenger = &wasmtesting.MockMessageHandler{}
Expand Down Expand Up @@ -87,6 +88,7 @@ func TestOnOpenChannel(t *testing.T) {
}

func TestOnConnectChannel(t *testing.T) {
SkipIfM1(t)
var m wasmtesting.MockWasmer
wasmtesting.MakeIBCInstantiable(&m)
var messenger = &wasmtesting.MockMessageHandler{}
Expand Down Expand Up @@ -198,6 +200,7 @@ func TestOnConnectChannel(t *testing.T) {
}

func TestOnCloseChannel(t *testing.T) {
SkipIfM1(t)
var m wasmtesting.MockWasmer
wasmtesting.MakeIBCInstantiable(&m)
var messenger = &wasmtesting.MockMessageHandler{}
Expand Down Expand Up @@ -308,6 +311,7 @@ func TestOnCloseChannel(t *testing.T) {
}

func TestOnRecvPacket(t *testing.T) {
SkipIfM1(t)
var m wasmtesting.MockWasmer
wasmtesting.MakeIBCInstantiable(&m)
var messenger = &wasmtesting.MockMessageHandler{}
Expand Down Expand Up @@ -470,6 +474,7 @@ func TestOnRecvPacket(t *testing.T) {
}

func TestOnAckPacket(t *testing.T) {
SkipIfM1(t)
var m wasmtesting.MockWasmer
wasmtesting.MakeIBCInstantiable(&m)
var messenger = &wasmtesting.MockMessageHandler{}
Expand Down Expand Up @@ -576,6 +581,7 @@ func TestOnAckPacket(t *testing.T) {
}

func TestOnTimeoutPacket(t *testing.T) {
SkipIfM1(t)
var m wasmtesting.MockWasmer
wasmtesting.MakeIBCInstantiable(&m)
var messenger = &wasmtesting.MockMessageHandler{}
Expand Down
6 changes: 6 additions & 0 deletions x/wasm/keeper/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ type InvestmentResponse struct {
}

func TestInitializeStaking(t *testing.T) {
SkipIfM1(t)
ctx, k := CreateTestInput(t, false, SupportedFeatures)
accKeeper, stakingKeeper, keeper, bankKeeper := k.AccountKeeper, k.StakingKeeper, k.ContractKeeper, k.BankKeeper

Expand Down Expand Up @@ -226,6 +227,7 @@ func initializeStaking(t *testing.T) initInfo {
}

func TestBonding(t *testing.T) {
SkipIfM1(t)
initInfo := initializeStaking(t)
ctx, valAddr, contractAddr := initInfo.ctx, initInfo.valAddr, initInfo.contractAddr
keeper, stakingKeeper, accKeeper, bankKeeper := initInfo.wasmKeeper, initInfo.stakingKeeper, initInfo.accKeeper, initInfo.bankKeeper
Expand Down Expand Up @@ -274,6 +276,7 @@ func TestBonding(t *testing.T) {
}

func TestUnbonding(t *testing.T) {
SkipIfM1(t)
initInfo := initializeStaking(t)
ctx, valAddr, contractAddr := initInfo.ctx, initInfo.valAddr, initInfo.contractAddr
keeper, stakingKeeper, accKeeper, bankKeeper := initInfo.wasmKeeper, initInfo.stakingKeeper, initInfo.accKeeper, initInfo.bankKeeper
Expand Down Expand Up @@ -339,6 +342,7 @@ func TestUnbonding(t *testing.T) {
}

func TestReinvest(t *testing.T) {
SkipIfM1(t)
initInfo := initializeStaking(t)
ctx, valAddr, contractAddr := initInfo.ctx, initInfo.valAddr, initInfo.contractAddr
keeper, stakingKeeper, accKeeper, bankKeeper := initInfo.wasmKeeper, initInfo.stakingKeeper, initInfo.accKeeper, initInfo.bankKeeper
Expand Down Expand Up @@ -407,6 +411,7 @@ func TestReinvest(t *testing.T) {
}

func TestQueryStakingInfo(t *testing.T) {
SkipIfM1(t)
// STEP 1: take a lot of setup from TestReinvest so we have non-zero info
initInfo := initializeStaking(t)
ctx, valAddr, contractAddr := initInfo.ctx, initInfo.valAddr, initInfo.contractAddr
Expand Down Expand Up @@ -586,6 +591,7 @@ func TestQueryStakingInfo(t *testing.T) {
}

func TestQueryStakingPlugin(t *testing.T) {
SkipIfM1(t)
// STEP 1: take a lot of setup from TestReinvest so we have non-zero info
initInfo := initializeStaking(t)
ctx, valAddr, contractAddr := initInfo.ctx, initInfo.valAddr, initInfo.contractAddr
Expand Down
4 changes: 4 additions & 0 deletions x/wasm/keeper/submsg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

// Try a simple send, no gas limit to for a sanity check before trying table tests
func TestDispatchSubMsgSuccessCase(t *testing.T) {
SkipIfM1(t)
ctx, keepers := CreateTestInput(t, false, ReflectFeatures)
accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.WasmKeeper, keepers.BankKeeper

Expand Down Expand Up @@ -108,6 +109,7 @@ func TestDispatchSubMsgSuccessCase(t *testing.T) {
}

func TestDispatchSubMsgErrorHandling(t *testing.T) {
SkipIfM1(t)
fundedDenom := "funds"
fundedAmount := 1_000_000
ctxGasLimit := uint64(1_000_000)
Expand Down Expand Up @@ -363,6 +365,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
// Test an error case, where the Encoded doesn't return any sdk.Msg and we trigger(ed) a null pointer exception.
// This occurs with the IBC encoder. Test this.
func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) {
SkipIfM1(t)
// fake out the bank handle to return success with no data
nilEncoder := func(sender sdk.AccAddress, msg *wasmvmtypes.BankMsg) ([]sdk.Msg, error) {
return nil, nil
Expand Down Expand Up @@ -439,6 +442,7 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) {

// Try a simple send, no gas limit to for a sanity check before trying table tests
func TestDispatchSubMsgConditionalReplyOn(t *testing.T) {
SkipIfM1(t)
ctx, keepers := CreateTestInput(t, false, ReflectFeatures)
keeper := keepers.WasmKeeper

Expand Down

0 comments on commit feeccb6

Please sign in to comment.