Skip to content

feat(test): add timeout#1595

Merged
marcossevilla merged 7 commits into
VeryGoodOpenSource:mainfrom
eliasreis54:fix/mcp-test-timeout
Jun 3, 2026
Merged

feat(test): add timeout#1595
marcossevilla merged 7 commits into
VeryGoodOpenSource:mainfrom
eliasreis54:fix/mcp-test-timeout

Conversation

@eliasreis54

@eliasreis54 eliasreis54 commented May 13, 2026

Copy link
Copy Markdown
Contributor

Status

READY

Description

Flutter tests can hang indefinitely when pumpAndSettle() is called without a timeout argument. The MCP server was waiting on the process forever with no way to recover.

Adds a timeout_seconds parameter (default 120) to the MCP test tool and a --timeout flag to very_good test. The value is passed directly to flutter test as --timeout=<seconds>s, delegating timeout enforcement to package:test.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Flutter tests can hang indefinitely when pumpAndSettle() is called
without a timeout argument. The MCP server was waiting on the process
forever with no way to recover.

Adds a timeout_seconds parameter (default 120) to the test tool. When
the timeout fires, sends SIGKILL to flutter_tester via pkill — the only
reliable mechanism to terminate a hung Flutter test process — then
returns an actionable error to the caller.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eliasreis54 eliasreis54 requested a review from a team as a code owner May 13, 2026 13:23
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@ryzizub ryzizub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @eliasreis54, this might fix the MCP issue where timeouts from flutter test aren't bubbled up. But since the same issue exists in the very_good test command itself, shouldn't the fix be applied there too?

There we might find better way to tackle this, because this might introduce many issues (120 seconds for large codebases is quite aggresive)

eliasreis54 and others added 4 commits May 18, 2026 08:28
Adds a --timeout <seconds> option to very_good test. When set, a Timer
fires pkill -KILL -f flutter_tester and completes the test run with a
non-zero exit code. No timeout is applied when the flag is omitted.

The MCP server's own .timeout() + pkill block is removed in favour of
passing --timeout directly to the CLI, keeping the kill logic in one place.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the custom Timer/pkill mechanism and instead pass
--timeout=${seconds}s directly to flutter test, which handles
the timeout natively via package:test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@ryzizub ryzizub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, only update of description on PR needed

@marcossevilla marcossevilla changed the title fix(mcp): add timeout and process kill to test tool fix(test): add timeout Jun 2, 2026
@marcossevilla marcossevilla changed the title fix(test): add timeout feat(test): add timeout Jun 3, 2026
@marcossevilla marcossevilla merged commit 3138466 into VeryGoodOpenSource:main Jun 3, 2026
23 checks passed
@vgvbot vgvbot mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants