+2 -16
View File
@@ -332,13 +332,10 @@ void main() {
String workspace = 'application', String workspace = 'application',
String? operation, String? operation,
}) async { }) async {
final id = ++requestId;
final elapsed = Stopwatch()..start();
stdout.writeln('MCP request $id: $name started');
socket.writeln( socket.writeln(
jsonEncode({ jsonEncode({
'jsonrpc': '2.0', 'jsonrpc': '2.0',
'id': id, 'id': ++requestId,
'method': 'tools/call', 'method': 'tools/call',
'params': { 'params': {
'_meta': { '_meta': {
@@ -354,19 +351,8 @@ void main() {
}, },
}), }),
); );
await socket.flush(); expect(await lines.moveNext().timeout(const Duration(seconds: 5)), true);
// Project tools persist real files. Await their response rather than
// imposing an unrelated transport SLA; the test's timeout bounds hangs.
expect(
await lines.moveNext(),
true,
reason: 'MCP stream closed for $name request $id',
);
stdout.writeln(
'MCP request $id: $name replied after ${elapsed.elapsedMilliseconds}ms',
);
final response = jsonDecode(lines.current) as Map; final response = jsonDecode(lines.current) as Map;
expect(response['id'], id, reason: '$response');
expect(response['error'], isNull, reason: '$response'); expect(response['error'], isNull, reason: '$response');
return (response['result'] as Map)['structuredContent'] as Map; return (response['result'] as Map)['structuredContent'] as Map;
} }