Skip to content

Commit

Permalink
monorepo: add timeouts for vitest (specific tests to timeout)
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer committed Jan 18, 2025
1 parent c9d69e3 commit 9782596
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions packages/ethash/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
testTimeout: 120_000,
},
})
2 changes: 1 addition & 1 deletion packages/evm/test/precompiles/09-blake2f.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('Precompiles: BLAKE2F', () => {
'should generate expected value',
)
assert.deepEqual(result.executionGasUsed, BigInt(t.gas), 'should use expected amount of gas')
})
}, 20_000)
}

for (const t of malformedCases) {
Expand Down
2 changes: 1 addition & 1 deletion packages/mpt/test/util/genesisState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ it('should correctly derive mainnet stateRoot from ethereumjs genesis', async ()
'0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544',
'mainnet stateRoot matches',
)
})
}, 20_000)
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('Verkle Tree API tests', () => {
matchingBytesLength(retrievedReallyBigByteCode, reallyBigByteCode),
reallyBigByteCode.length,
)
})
}, 120_000)
it('should put and get storage', async () => {
const zeroSlot = setLengthLeft(bigIntToBytes(0n), 32)
const zeroSlotValue = hexToBytes('0x1')
Expand Down
2 changes: 1 addition & 1 deletion packages/statemanager/test/vmState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('stateManager', () => {
expectedStateRoot,
`generateCanonicalGenesis should produce correct state root for mainnet from common`,
)
})
}, 10_000)

it(`should generate the genesis state root correctly for all other chains`, async () => {
const chains: [Chain, Uint8Array][] = [
Expand Down
2 changes: 1 addition & 1 deletion packages/tx/test/eip4844.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ describe('Network wrapper tests', () => {
undefined,
"throws when versioned hashes don't match kzg commitments",
)
})
}, 20_000)
})

describe('hash() and signature verification', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/tx/test/t9n.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function runTests(filePath: string) {
assert.ok(true, 'RLP decoding successfully failed')
}
}
})
}, 20_000)
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,6 @@ describe('EIP 2935: historical block hashes', () => {
const blockHashI = await testBlockhashContract(vm, block, BigInt(i))
assert.ok(equalsBytes(blockHashI, setLengthLeft(bigIntToBytes(BigInt(0)), 32)))
}
})
}, 10_000)
}
})

0 comments on commit 9782596

Please sign in to comment.