fix hanging stdio servers (#1200)
Co-authored-by: Johnny Santos <johnnyadsantos@gmail.com> Co-authored-by: TomasRup <tomasr@wix.com>
This commit is contained in:
parent
5aaf6ee67e
commit
ace9b62d3c
5 changed files with 220 additions and 47 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { completable, getCompleter } from './completable.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../shared/zodTestMatrix.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../__fixtures__/zodTestMatrix.js';
|
||||
|
||||
describe.each(zodTestMatrix)('completable with $zodVersionLabel', (entry: ZodMatrixEntry) => {
|
||||
const { z } = entry;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import {
|
|||
import { completable } from './completable.js';
|
||||
import { McpServer, ResourceTemplate } from './mcp.js';
|
||||
import { InMemoryTaskStore } from '../experimental/tasks/stores/in-memory.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../shared/zodTestMatrix.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../__fixtures__/zodTestMatrix.js';
|
||||
|
||||
function createLatch() {
|
||||
let latch = false;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { McpServer } from './mcp.js';
|
|||
import { createServer, type Server } from 'node:http';
|
||||
import { AddressInfo } from 'node:net';
|
||||
import { CallToolResult, JSONRPCMessage } from '../types.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../shared/zodTestMatrix.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../__fixtures__/zodTestMatrix.js';
|
||||
|
||||
const createMockResponse = () => {
|
||||
const res = {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { EventStore, StreamableHTTPServerTransport, EventId, StreamId } from './
|
|||
import { McpServer } from './mcp.js';
|
||||
import { CallToolResult, JSONRPCMessage } from '../types.js';
|
||||
import { AuthInfo } from './auth/types.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../shared/zodTestMatrix.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../__fixtures__/zodTestMatrix.js';
|
||||
|
||||
async function getFreePort() {
|
||||
return new Promise(res => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Server } from './index.js';
|
|||
import { Client } from '../client/index.js';
|
||||
import { InMemoryTransport } from '../inMemory.js';
|
||||
import { McpServer, ResourceTemplate } from './mcp.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../shared/zodTestMatrix.js';
|
||||
import { zodTestMatrix, type ZodMatrixEntry } from '../__fixtures__/zodTestMatrix.js';
|
||||
|
||||
describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
|
||||
const { z } = entry;
|
||||
|
|
|
|||
Loading…
Reference in a new issue