Skip to content

Commit 7c6dcba

Browse files
committed
Fix await server.close() which is too slow with Fastify 4.10.2
1 parent 7c93729 commit 7c6dcba

File tree

4 files changed

+96
-50
lines changed

4 files changed

+96
-50
lines changed

src/Http.test.e2e.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ test('get()', async ({ page }) => {
3434
const response = await page.evaluate(url => window.Http.get(url).text(), url);
3535
expect(response).toEqual('GET');
3636

37-
await server.close();
37+
// FIXME await close() is too slow with Fastify 4.10.2
38+
server.close();
3839
});
3940

4041
test('postJSON()', async ({ page }) => {
@@ -57,7 +58,8 @@ test('postJSON()', async ({ page }) => {
5758
});
5859
expect(response).toEqual('POST');
5960

60-
await server.close();
61+
// FIXME await close() is too slow with Fastify 4.10.2
62+
server.close();
6163
});
6264

6365
test('404 Not Found', async ({ page }) => {
@@ -72,7 +74,8 @@ test('404 Not Found', async ({ page }) => {
7274

7375
await expect(page.evaluate(url => window.Http.get(url).text(), url)).rejects.toThrow('Not Found');
7476

75-
await server.close();
77+
// FIXME await close() is too slow with Fastify 4.10.2
78+
server.close();
7679
});
7780

7881
function getCorsErrorMessage(browserEngine: string | undefined) {
@@ -113,7 +116,8 @@ test('CORS fail', async ({ page }) => {
113116
getCorsErrorMessage(browserEngine)
114117
);
115118

116-
await server.close();
119+
// FIXME await close() is too slow with Fastify 4.10.2
120+
server.close();
117121
});
118122

119123
function getAbortedErrorMessage(browserEngine: string | undefined) {
@@ -159,7 +163,8 @@ test('abort request', async ({ page }) => {
159163
}, url)
160164
).rejects.toThrow(getAbortedErrorMessage(browserEngine));
161165

162-
await server.close();
166+
// FIXME await close() is too slow with Fastify 4.10.2
167+
server.close();
163168
});
164169

165170
test('HTTPS + HTTP/2', async ({ page }) => {
@@ -182,9 +187,8 @@ test('HTTPS + HTTP/2', async ({ page }) => {
182187
const response = await page.evaluate(url => window.Http.get(url).text(), url);
183188
expect(response).toEqual('GET');
184189

185-
// FIXME This test is very slow with Fastify 4.10.2
186-
test.setTimeout(100_000);
187-
await server.close();
190+
// FIXME await close() is too slow with Fastify 4.10.2
191+
server.close();
188192
});
189193

190194
// ["you can connect to HTTP2 in plain text, however, this is not supported by browsers"](https://www.fastify.io/docs/v4.10.x/Reference/HTTP2/#plain-or-insecure)
@@ -204,5 +208,6 @@ test.skip('HTTP + HTTP/2', async ({ page }) => {
204208
const response = await page.evaluate(async url => window.Http.get(url).text(), url);
205209
expect(response).toEqual('GET');
206210

207-
await server.close();
211+
// FIXME await close() is too slow with Fastify 4.10.2
212+
server.close();
208213
});

0 commit comments

Comments
 (0)