Skip to content

Commit

Permalink
revert: "ci: try to fix request timeouts (#11183)" (#11184)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf-2 authored Oct 17, 2023
1 parent 57dc357 commit 20ee325
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions packages/testserver/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export class TestServer {
#csp = new Map<string, string>();
#gzipRoutes = new Set<string>();
#requestSubscribers = new Map<string, Subscriber>();
#requests = new Set<ServerResponse>();

static async create(dirPath: string): Promise<TestServer> {
let res!: (value: unknown) => void;
Expand Down Expand Up @@ -193,20 +192,12 @@ export class TestServer {
subscriber.reject.call(undefined, error);
}
this.#requestSubscribers.clear();
for (const request of this.#requests.values()) {
if (!request.writableEnded) {
request.end();
}
}
this.#requests.clear();
}

#onRequest: RequestListener = (
request: TestIncomingMessage,
response
): void => {
this.#requests.add(response);

request.on('error', (error: {code: string}) => {
if (error.code === 'ECONNRESET') {
response.end();
Expand Down

0 comments on commit 20ee325

Please sign in to comment.