Compare commits
@@ -332,10 +332,13 @@ 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': ++requestId,
|
'id': id,
|
||||||
'method': 'tools/call',
|
'method': 'tools/call',
|
||||||
'params': {
|
'params': {
|
||||||
'_meta': {
|
'_meta': {
|
||||||
@@ -351,8 +354,19 @@ void main() {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
expect(await lines.moveNext().timeout(const Duration(seconds: 5)), true);
|
await socket.flush();
|
||||||
|
// 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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user