Synchronize MCP tests with matching persisted tool responses (#16)
Gitea CI / Check code and tests (push) Successful in 12m52s
Gitea CI / Build Windows x64 app (push) Successful in 4m17s
Gitea CI / Build Android APK (push) Successful in 4m18s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m15s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m8s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea CI / Check code and tests (push) Successful in 12m52s
Gitea CI / Build Windows x64 app (push) Successful in 4m17s
Gitea CI / Build Android APK (push) Successful in 4m18s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m15s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m8s
Gitea CI / Gitea CI passed (push) Successful in 2s
This commit was merged in pull request #16.
This commit is contained in:
1 parent
8785eaf095
commit
e0c844ee58
1 file changed
+16
-2
@@ -332,10 +332,13 @@ void main() {
|
||||
String workspace = 'application',
|
||||
String? operation,
|
||||
}) async {
|
||||
final id = ++requestId;
|
||||
final elapsed = Stopwatch()..start();
|
||||
stdout.writeln('MCP request $id: $name started');
|
||||
socket.writeln(
|
||||
jsonEncode({
|
||||
'jsonrpc': '2.0',
|
||||
'id': ++requestId,
|
||||
'id': id,
|
||||
'method': 'tools/call',
|
||||
'params': {
|
||||
'_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;
|
||||
expect(response['id'], id, reason: '$response');
|
||||
expect(response['error'], isNull, reason: '$response');
|
||||
return (response['result'] as Map)['structuredContent'] as Map;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user