Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion contracts/test/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,22 @@ async function execute(command, interaction=`printf "12345678\\n"`){
}

function execCommand(command) {
// Cap shelled-out child processes (typically `docker exec ... seid ...`)
// with a timeout so an indefinite stall surfaces as an error with the
// command text, instead of consuming the entire job's wall-clock budget.
// The Autobahn EVM matrix has hit multiple 30-minute job timeouts where
// hardhat went silent between test files; suspect path is a stalled
// child here. Override via EXEC_TIMEOUT_MS for tests that legitimately
// need longer.
const timeoutMs = Number(process.env.EXEC_TIMEOUT_MS || 60000)
return new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
exec(command, { timeout: timeoutMs, killSignal: "SIGKILL" }, (error, stdout, stderr) => {
if (error) {
if (error.killed || error.signal) {
const summary = command.length > 200 ? command.slice(0, 197) + "..." : command
reject(new Error(`execCommand timed out after ${timeoutMs}ms: ${summary}`))
return
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overly broad signal check misattributes non-timeout kills

Low Severity

The condition error.killed || error.signal catches any signal-terminated process, not just timeout kills. error.killed is only true when Node.js itself killed the process (i.e., the timeout fired), but error.signal is set for any signal death — including external OOM kills, CI runner resource-limit kills, or cleanup scripts. In those cases the rejection message incorrectly says "execCommand timed out after ${timeoutMs}ms", sending engineers looking for timeout causes when the actual issue is something else entirely. Since this PR's whole purpose is improving diagnostics, the condition could be narrowed to just error.killed to avoid misattribution.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c9247d6. Configure here.

}
reject(error);
return;
}
Expand Down
Loading