Skip to content

Commit 794752c

Browse files
authored
Merge pull request #12765 from ethereum/euler-timeout-fix
Increase Hardhat timeout in Euler ext test
2 parents 02637d5 + 9ef600e commit 794752c

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

test/externalTests/common.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,36 @@ function force_truffle_compiler_settings
233233
function name_hardhat_default_export
234234
{
235235
local config_file="$1"
236-
local config_var_name="$2"
237236

238237
local import="import {HardhatUserConfig} from 'hardhat/types';"
239238
local config="const config: HardhatUserConfig = {"
240239
sed -i "s|^\s*export\s*default\s*{|${import}\n${config}|g" "$config_file"
241240
echo "export default config;" >> "$config_file"
242241
}
243242

243+
function force_hardhat_timeout
244+
{
245+
local config_file="$1"
246+
local config_var_name="$2"
247+
local new_timeout="$3"
248+
249+
printLog "Configuring Hardhat..."
250+
echo "-------------------------------------"
251+
echo "Timeout: ${new_timeout}"
252+
echo "-------------------------------------"
253+
254+
if [[ $config_file == *\.js ]]; then
255+
[[ $config_var_name == "" ]] || assertFail
256+
echo "module.exports.mocha = module.exports.mocha || {timeout: ${new_timeout}}"
257+
echo "module.exports.mocha.timeout = ${new_timeout}"
258+
else
259+
[[ $config_file == *\.ts ]] || assertFail
260+
[[ $config_var_name != "" ]] || assertFail
261+
echo "${config_var_name}.mocha = ${config_var_name}.mocha ?? {timeout: ${new_timeout}};"
262+
echo "${config_var_name}.mocha!.timeout = ${new_timeout}"
263+
fi >> "$config_file"
264+
}
265+
244266
function force_hardhat_compiler_binary
245267
{
246268
local config_file="$1"

test/externalTests/euler.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ function euler_test
6363
force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH"
6464
force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")"
6565
force_hardhat_unlimited_contract_size "$config_file"
66+
# Workaround for the timeout that's too short for unoptimized code (https://github.com/ethereum/solidity/pull/12765)
67+
force_hardhat_timeout "$config_file" "" 100000
6668
npm install
6769

6870
replace_version_pragmas

0 commit comments

Comments
 (0)