Problem
Conflicts were observed due to multiple WASM initializations causing lock contention.
Solution
Create tmporary home dir for integration test to prevent lock contention.
// CreateEvmd creates an evm app for regular integration tests (non-mempool)
// This version uses a noop mempool to avoid state issues during transaction processing
func CreateEvmd(chainID string, evmChainID uint64, customBaseAppOptions ...func(*baseapp.BaseApp)) evm.EvmApp {
// A temporary home directory is created and used to prevent race conditions
// related to home directory locks in chains that use the WASM module.
defaultNodeHome, err := os.MkdirTemp("", "evmd-temp-homedir")
if err != nil {
panic(err)
}
db := dbm.NewMemDB()
logger := log.NewNopLogger()
loadLatest := true
appOptions := NewAppOptionsWithFlagHomeAndChainID(defaultNodeHome, evmChainID)
baseAppOptions := append(customBaseAppOptions, baseapp.SetChainID(chainID))
return evmd.NewExampleApp(
logger,
db,
nil,
loadLatest,
appOptions,
baseAppOptions...,
)
}